From cdf79eb9ee4d7d5f1e4b5e20d9ac257bb7d8f448 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 6. --- evdev/uinput.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/evdev/uinput.py b/evdev/uinput.py index edf948f..5582e55 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 6 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