]> granicus.if.org Git - python/commitdiff
Issue #12045: Avoid duplicate execution of command in ctypes.util._get_soname().
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 25 May 2011 16:17:25 +0000 (18:17 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 25 May 2011 16:17:25 +0000 (18:17 +0200)
Patch by Sijin Joseph.

Lib/ctypes/util.py
Misc/NEWS

index e4c204da9ecd48979514fc965c881fe30043ac0d..6815f941d568ffd464ac3405a0a74bbd4d13e4a7 100644 (file)
@@ -137,9 +137,7 @@ elif os.name == "posix":
             rv = f.close()
             if rv == 10:
                 raise OSError('objdump command not found')
-            with contextlib.closing(os.popen(cmd)) as f:
-                data = f.read()
-            res = re.search(r'\sSONAME\s+([^\s]+)', data)
+            res = re.search(r'\sSONAME\s+([^\s]+)', dump)
             if not res:
                 return None
             return res.group(1)
index 36a3c9da183130a3605907fb153de04f8cc1ab0d..cba2d50cdaf2913779498520c90696e6dcf522e7 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -161,6 +161,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #12045: Avoid duplicate execution of command in ctypes.util._get_soname().
+  Patch by Sijin Joseph.
+
 - Issue #10818: Remove the Tk GUI and the serve() function of the pydoc module,
   pydoc -g has been deprecated in Python 3.2 and it has a new enhanced web
   server.