[Python-checkins] r58158 - in python/branches/release25-maint: Lib/ctypes/util.py Misc/NEWS

thomas.heller python-checkins at python.org
Fri Sep 14 22:05:26 CEST 2007


Author: thomas.heller
Date: Fri Sep 14 22:05:26 2007
New Revision: 58158

Modified:
   python/branches/release25-maint/Lib/ctypes/util.py
   python/branches/release25-maint/Misc/NEWS
Log:
ctypes.util.find_library uses dump(1) instead of objdump(1) on Solaris.
Fixes issue #1777530; backported from trunk.

Modified: python/branches/release25-maint/Lib/ctypes/util.py
==============================================================================
--- python/branches/release25-maint/Lib/ctypes/util.py	(original)
+++ python/branches/release25-maint/Lib/ctypes/util.py	Fri Sep 14 22:05:26 2007
@@ -66,15 +66,27 @@
             return None
         return res.group(0)
 
-    def _get_soname(f):
-        # assuming GNU binutils / ELF
-        if not f:
-            return None
-        cmd = "objdump -p -j .dynamic 2>/dev/null " + f
-        res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
-        if not res:
-            return None
-        return res.group(1)
+
+    if sys.platform == "sunos5":
+        # use /usr/ccs/bin/dump on solaris
+        def _get_soname(f):
+            if not f:
+                return None
+            cmd = "/usr/ccs/bin/dump -Lpv 2>/dev/null " + f
+            res = re.search(r'\[.*\]\sSONAME\s+([^\s]+)', os.popen(cmd).read())
+            if not res:
+                return None
+            return res.group(1)
+    else:
+        def _get_soname(f):
+            # assuming GNU binutils / ELF
+            if not f:
+                return None
+            cmd = "objdump -p -j .dynamic 2>/dev/null " + f
+            res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
+            if not res:
+                return None
+            return res.group(1)
 
     if (sys.platform.startswith("freebsd")
         or sys.platform.startswith("openbsd")

Modified: python/branches/release25-maint/Misc/NEWS
==============================================================================
--- python/branches/release25-maint/Misc/NEWS	(original)
+++ python/branches/release25-maint/Misc/NEWS	Fri Sep 14 22:05:26 2007
@@ -32,6 +32,9 @@
 Library
 -------
 
+- Bug #1777530: ctypes.util.find_library uses dump(1) instead of
+  objdump(1) on Solaris.
+
 - Bug #1153: repr.repr() now doesn't require set and dictionary items
   to be orderable to properly represent them.
 


More information about the Python-checkins mailing list