Skip to content

Commit 61c337d

Browse files
committed
cherry-pick test fixes from python/cpython@4176193
1 parent 96bbfcb commit 61c337d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

graalpython/lib-python/3/ctypes/test/test_macholib.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,22 @@ class MachOTest(unittest.TestCase):
4646
@unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test')
4747
def test_find(self):
4848

49-
self.assertEqual(find_lib('pthread'),
50-
'/usr/lib/libSystem.B.dylib')
49+
# On Mac OS 11, system dylibs are only present in the shared cache,
50+
# so symlinks like libpthread.dylib -> libSystem.B.dylib will not
51+
# be resolved by dyld_find
52+
self.assertIn(find_lib('pthread'),
53+
('/usr/lib/libSystem.B.dylib', '/usr/lib/libpthread.dylib'))
5154

5255
result = find_lib('z')
5356
# Issue #21093: dyld default search path includes $HOME/lib and
5457
# /usr/local/lib before /usr/lib, which caused test failures if
5558
# a local copy of libz exists in one of them. Now ignore the head
5659
# of the path.
57-
self.assertRegex(result, r".*/lib/libz\..*.*\.dylib")
60+
self.assertRegex(result, r".*/lib/libz.*\.dylib")
5861

59-
self.assertEqual(find_lib('IOKit'),
60-
'/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit')
62+
self.assertIn(find_lib('IOKit'),
63+
('/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit',
64+
'/System/Library/Frameworks/IOKit.framework/IOKit'))
6165

6266
if __name__ == "__main__":
6367
unittest.main()

0 commit comments

Comments
 (0)