summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-03-29 00:08:44 -0700
committerNed Deily <nad@acm.org>2014-03-29 00:08:44 -0700
commitc420343c0cb83dc8d343a144a686597598aa03da (patch)
tree3d8332d6533e728d6711be749272e3f99ab54778
parent9aa00d1cd1691866269b4dd5e2ab5bcd3bc08940 (diff)
downloadcpython-git-c420343c0cb83dc8d343a144a686597598aa03da.tar.gz
Issue #21093: Prevent failures of ctypes test_macholib on OS X if a
copy of libz exists in $HOME/lib or /usr/local/lib.
-rw-r--r--Lib/ctypes/test/test_macholib.py7
-rw-r--r--Misc/NEWS3
2 files changed, 8 insertions, 2 deletions
diff --git a/Lib/ctypes/test/test_macholib.py b/Lib/ctypes/test/test_macholib.py
index fd2683764c..8a2b2c394c 100644
--- a/Lib/ctypes/test/test_macholib.py
+++ b/Lib/ctypes/test/test_macholib.py
@@ -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')
diff --git a/Misc/NEWS b/Misc/NEWS
index c68238641c..38928f8f68 100644
--- 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
-----------