Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c420343

Browse files
committed
Issue #21093: Prevent failures of ctypes test_macholib on OS X if a
copy of libz exists in $HOME/lib or /usr/local/lib.
1 parent 9aa00d1 commit c420343

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lib/ctypes/test/test_macholib.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ def test_find(self):
5050
'/usr/lib/libSystem.B.dylib')
5151

5252
result = find_lib('z')
53-
self.assertTrue(result.startswith('/usr/lib/libz.1'))
54-
self.assertTrue(result.endswith('.dylib'))
53+
# Issue #21093: dyld default search path includes $HOME/lib and
54+
# /usr/local/lib before /usr/lib, which caused test failures if
55+
# a local copy of libz exists in one of them. Now ignore the head
56+
# of the path.
57+
self.assertRegex(result, r".*/lib/libz\..*.*\.dylib")
5558

5659
self.assertEqual(find_lib('IOKit'),
5760
'/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit')

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ Tests
129129
- Issue #20668: asyncio tests no longer rely on tests.txt file.
130130
(Patch by Vajrasky Kok)
131131

132+
- Issue #21093: Prevent failures of ctypes test_macholib on OS X if a
133+
copy of libz exists in $HOME/lib or /usr/local/lib.
134+
132135
Tools/Demos
133136
-----------
134137

0 commit comments

Comments
 (0)