]> granicus.if.org Git - python/commitdiff
Issue #21093: Prevent failures of ctypes test_macholib on OS X if a
authorNed Deily <nad@acm.org>
Sat, 29 Mar 2014 07:08:44 +0000 (00:08 -0700)
committerNed Deily <nad@acm.org>
Sat, 29 Mar 2014 07:08:44 +0000 (00:08 -0700)
copy of libz exists in $HOME/lib or /usr/local/lib.

Lib/ctypes/test/test_macholib.py
Misc/NEWS

index fd2683764c79f8236d8c3f2d1235f431a4182704..8a2b2c394ce204822a272c5c1a59833441d99126 100644 (file)
@@ -50,8 +50,11 @@ class MachOTest(unittest.TestCase):
                                  '/usr/lib/libSystem.B.dylib')
 
             result = find_lib('z')
-            self.assertTrue(result.startswith('/usr/lib/libz.1'))
-            self.assertTrue(result.endswith('.dylib'))
+            # Issue #21093: dyld default search path includes $HOME/lib and
+            # /usr/local/lib before /usr/lib, which caused test failures if
+            # a local copy of libz exists in one of them. Now ignore the head
+            # of the path.
+            self.assertRegex(result, r".*/lib/libz\..*.*\.dylib")
 
             self.assertEqual(find_lib('IOKit'),
                                  '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit')
index c68238641cc86b7184dabda37668051bde17d7ff..38928f8f688915caf3524d51bd5632005e22454b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -129,6 +129,9 @@ Tests
 - Issue #20668: asyncio tests no longer rely on tests.txt file.
   (Patch by Vajrasky Kok)
 
+- Issue #21093: Prevent failures of ctypes test_macholib on OS X if a
+  copy of libz exists in $HOME/lib or /usr/local/lib.
+
 Tools/Demos
 -----------