From 3be8d93b1081c4d617b5d9fd66e35074b1ebeefe Mon Sep 17 00:00:00 2001 From: Malik Shahzad Muzaffar Date: Tue, 15 Sep 2026 09:05:50 +0200 Subject: [PATCH] Fix build issues when Python with free-threading is used Building pasparser with pythin 3.14 (free-threading enabled) failed with error [a]. This change allows to find the correct `lib.linux-x86_64-cpython-314t'` lib [a] ``` Build dir: %s pacparser/src/../tests/../src/pymod/build ['lib.linux-x86_64-cpython-314t', 'temp.linux-x86_64-cpython-314t'] Traceback (most recent call last): File "pacparser/src/../tests/runtests.py", line 39, in runtests pacparser_module_path = module_path(tests_dir) File "pacparser-/src/../tests/runtests.py", line 35, in module_path return glob.glob(os.path.join(builddir, 'lib*%s' % py_ver))[0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "pacparser/src/../tests/runtests.py", line 88, in main() ~~~~^^ File "pacparser/src/../tests/runtests.py", line 85, in main runtests(pacfile, testdata, tests_dir) ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "pacparser/src/../tests/runtests.py", line 41, in runtests raise Exception('Tests failed. Could not determine pacparser path.') ``` --- tests/runtests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/runtests.py b/tests/runtests.py index 4c55191..7e9c3cc 100644 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -27,7 +27,7 @@ import tempfile def module_path(tests_dir): - py_ver = '*'.join([str(x) for x in sys.version_info[0:2]]) + py_ver = f"{sys.version_info[0]}{sys.version_info[1]}{sys.abiflags}" builddir = os.path.join(tests_dir, '..', 'src', 'pymod', 'build') print('Build dir: %s', builddir)