Skip to content

Commit 899d25c

Browse files
committed
Add '.so' as additional shared object suffix
EXT_SUFFIX includes a platform information tag starting from Python 3.5 [0] For example: >>> sysconfig.get_config_var("EXT_SUFFIX") '.cpython-38-aarch64-linux-gnu.so' This suffix only applies to cpython extensions i.e. not to the iptables shared objects. Adding '.so' as an additional suffix for shared objects fixes the issue. Fixes: Issue #301 Signed-off-by: Frank Vanbever <frank.vanbever@essensium.com> [0]: https://docs.python.org/3/whatsnew/3.5.html#build-and-c-api-changes
1 parent be6f563 commit 899d25c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

iptc/util.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,19 @@ def _do_find_library(name):
8080

8181

8282
def _find_library(*names):
83+
exts = []
8384
if version_info >= (3, 3):
84-
ext = get_config_var("EXT_SUFFIX")
85+
exts.append(get_config_var("EXT_SUFFIX"))
8586
else:
86-
ext = get_config_var('SO')
87+
exts.append(get_config_var('SO'))
88+
89+
if version_info >= (3, 5):
90+
exts.append('.so')
91+
8792
for name in names:
88-
libnames = [name, "lib" + name, name + ext, "lib" + name + ext]
93+
libnames = [name, "lib" + name]
94+
for ext in exts:
95+
libnames += [name + ext, "lib" + name + ext]
8996
libdir = os.environ.get('IPTABLES_LIBDIR', None)
9097
if libdir is not None:
9198
libdirs = libdir.split(':')

0 commit comments

Comments
 (0)