From 87c99f7b73039d5edf51c18b8b63259fb477e45b Mon Sep 17 00:00:00 2001 From: Kars Mulder Date: Sun, 28 Apr 2024 11:18:36 +0000 Subject: [PATCH] Provide fallback value for FF_MAX_EFFECTS (#219) 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