Skip to content

Commit 87c99f7

Browse files
authored
Provide fallback value for FF_MAX_EFFECTS (#219)
This is required to make python-evdev work on CentOS 7.
1 parent cb41241 commit 87c99f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

evdev/uinput.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ def __init__(
9090
devnode="/dev/uinput",
9191
phys="py-evdev-uinput",
9292
input_props=None,
93-
max_effects=ecodes.FF_MAX_EFFECTS,
93+
# CentOS 7 has sufficiently old headers that FF_MAX_EFFECTS is not defined there,
94+
# which causes the whole module to fail loading. Fallback on a hardcoded value of
95+
# FF_MAX_EFFECTS if it is not defined in the ecodes.
96+
max_effects=ecodes.ecodes.get("FF_MAX_EFFECTS", 96),
9497
):
9598
"""
9699
Arguments

0 commit comments

Comments
 (0)