test: rename a variable to shut up ruff with default args

We disable that warning in the CI and pre-commit but it's a simple
fix here that makes sense.

        test/test_oeffis.py:185:9: E741 Ambiguous variable name: `l`

Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/319>
This commit is contained in:
Peter Hutterer 2024-12-09 09:35:10 +10:00
parent 504afdea4a
commit d4b60a7d0d

View file

@ -182,13 +182,13 @@ class Oeffis:
"""
def __init__(self, userdata=None):
l = LibOeffis.instance()
self.ctx = l.oeffis_new(userdata) # type: ignore
lib = LibOeffis.instance()
self.ctx = lib.oeffis_new(userdata) # type: ignore
def wrapper(func):
return lambda *args, **kwargs: func(self.ctx, *args, **kwargs)
for api in l._api_prototypes:
for api in lib._api_prototypes:
# skip some APIs that are not be exposed because they don't make sense
# to have in python.
if api.name not in (
@ -197,11 +197,11 @@ class Oeffis:
"oeffis_get_user_data",
"oeffis_set_user_data",
):
func = getattr(l, api.name)
func = getattr(lib, api.name)
setattr(self, api.basename, wrapper(func))
for e in l._enums:
val = getattr(l, e.name)
for e in lib._enums:
val = getattr(lib, e.name)
setattr(self, e.basename, val)
@property