Skip to content

Commit efeffa3

Browse files
Fix Python3-compatibility issue: add soabi part to .so filepath
1 parent 8ea2672 commit efeffa3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ def _error_handler(result, fn, args):
6666
raise RuntimeError("unexpected return value: %s" % result)
6767
return result
6868

69-
_libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "_libsuinput" + sysconfig.get_config_var("SO")))
69+
_soabi = ""
70+
if sysconfig.get_config_var("SOABI"):
71+
_soabi = ".%s" % sysconfig.get_config_var("SOABI")
72+
73+
_libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "_libsuinput" + _soabi + sysconfig.get_config_var("SO")))
7074
_libsuinput = ctypes.CDLL(_libsuinput_path, use_errno=True)
7175
_libsuinput.suinput_open.errcheck = _error_handler
7276
_libsuinput.suinput_enable_event.errcheck = _error_handler

0 commit comments

Comments
 (0)