]> 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:07:42 +0000 (00:07 -0700)
committerNed Deily <nad@acm.org>
Sat, 29 Mar 2014 07:07:42 +0000 (00:07 -0700)
copy of libz exists in $HOME/lib or /usr/local/lib.

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

index eda846d30a150f08ed36f0878e71f90adb8143b1..cf50f50c79527cd37a8db206955f47a68cfb4947 100644 (file)
@@ -52,8 +52,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.assertRegexpMatches(result, r".*/lib/libz\..*.*\.dylib")
 
             self.assertEqual(find_lib('IOKit'),
                                  '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit')
index baeffbbb08e20204931c67be6993d49e01232783..d08d0c1d6a01006f817d6086b641e3b34e8d13d9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -336,6 +336,9 @@ Tests
   redirect of http://www.python.org/ to https://www.python.org:
   use http://www.example.com instead.
 
+- Issue #21093: Prevent failures of ctypes test_macholib on OS X if a
+  copy of libz exists in $HOME/lib or /usr/local/lib.
+
 Documentation
 -------------