Skip to content

Commit c9c550f

Browse files
authored
BUG: Resolve links before sorting library paths.
Maybe this will work better? I should look into whether ELF `so`s store their basename.
1 parent bd5b614 commit c9c550f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

distutils/tests/test_build_ext.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import contextlib
22
import glob
33
import importlib
4-
import os
4+
import os.path
55
import platform
66
import re
77
import shutil
@@ -112,8 +112,8 @@ def test_build_ext(self, copy_so):
112112
runtime_library_dirs=['/usr/lib'],
113113
)
114114
elif sys.platform == 'linux':
115-
libz_so = glob.glob('/usr/lib*/libz.so*')
116-
libz_so.sort(key=lambda lib_path: len(lib_path))
115+
libz_so = {os.path.realpath(name) for name in glob.iglob('/usr/lib*/libz.so*')}
116+
libz_so = sorted(libz_so, key=lambda lib_path: len(lib_path))
117117
shutil.copyfile(libz_so[-1], '/tmp/libxx_z.so')
118118

119119
xx_ext = Extension(

0 commit comments

Comments
 (0)