]> granicus.if.org Git - python/commitdiff
bpo-33281: Fix ctypes.util.find_library regression on macOS (GH-6625) (GH-6680)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 2 May 2018 02:51:31 +0000 (19:51 -0700)
committerNed Deily <nad@python.org>
Wed, 2 May 2018 02:51:31 +0000 (22:51 -0400)
(cherry picked from commit d06d345f04b3f7e5b318df69b1d179328a64ca9c)

Co-authored-by: Ray Donnelly <mingw.android@gmail.com>
Lib/ctypes/util.py

index 5e8b31a8546a02410dae0638727f5bfc503dee9c..97973bce001d9a539bb5e3d2afda194cdc4f2184 100644 (file)
@@ -67,7 +67,7 @@ if os.name == "nt":
                 return fname
         return None
 
-if os.name == "posix" and sys.platform == "darwin":
+elif os.name == "posix" and sys.platform == "darwin":
     from ctypes.macholib.dyld import dyld_find as _dyld_find
     def find_library(name):
         possible = ['lib%s.dylib' % name,
@@ -80,7 +80,7 @@ if os.name == "posix" and sys.platform == "darwin":
                 continue
         return None
 
-if sys.platform.startswith("aix"):
+elif sys.platform.startswith("aix"):
     # AIX has two styles of storing shared libraries
     # GNU auto_tools refer to these as svr4 and aix
     # svr4 (System V Release 4) is a regular file, often with .so as suffix