From e455d4a25f38bf66efdef0c9f72b88384e50ba8e Mon Sep 17 00:00:00 2001 From: Kars Mulder Date: Sat, 27 Apr 2024 14:25:35 +0200 Subject: [PATCH] Provide fallback value for FF_MAX_EFFECTS This is required to make python-evdev work on CentOS 7. --- evdev/uinput.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/evdev/uinput.py b/evdev/uinput.py index edf948f..476a84a 100644 --- a/evdev/uinput.py +++ b/evdev/uinput.py @@ -90,7 +90,10 @@ def __init__( devnode="/dev/uinput", phys="py-evdev-uinput", input_props=None, - max_effects=ecodes.FF_MAX_EFFECTS, + # CentOS 7 has sufficiently old headers that FF_MAX_EFFECTS is not defined there, + # which causes the whole module to fail loading. Fallback on a hardcoded value of + # FF_MAX_EFFECTS if it is not defined in the ecodes. + max_effects=ecodes.ecodes.get("FF_MAX_EFFECTS", 96), ): """ Arguments