Skip to content

Commit a8c21af

Browse files
committed
Python 2.7 compatibility fix
1 parent f3dbdd1 commit a8c21af

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

evdev/uinput.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class UInput(EventIO):
3232
)
3333

3434
@classmethod
35-
def from_device(cls, *devices, filtered_types=(ecodes.EV_SYN, ecodes.EV_FF), **kwargs):
35+
def from_device(cls, *devices, **kwargs):
3636
'''
3737
Create an UInput device with the capabilities of one or more input
3838
devices.
@@ -49,6 +49,9 @@ def from_device(cls, *devices, filtered_types=(ecodes.EV_SYN, ecodes.EV_FF), **k
4949
Keyword arguments to UInput constructor (i.e. name, vendor etc.).
5050
'''
5151

52+
# TODO: Move back to the argument list once Python 2 support is dropped.
53+
filtered_types = kwargs.pop('filtered_types', (ecodes.EV_SYN, ecodes.EV_FF))
54+
5255
device_instances = []
5356
for dev in devices:
5457
if not isinstance(dev, device.InputDevice):

0 commit comments

Comments
 (0)