Commit ec621306 authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #12045: Avoid duplicate execution of command in ctypes.util._get_soname().

Patch by Sijin Joseph.
parent 12d547a8
......@@ -137,16 +137,13 @@ elif os.name == "posix":
cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \
"objdump -p -j .dynamic 2>/dev/null " + f
f = os.popen(cmd)
dump = f.read()
rv = f.close()
if rv == 10:
raise OSError, 'objdump command not found'
f = os.popen(cmd)
try:
data = f.read()
dump = f.read()
finally:
f.close()
res = re.search(r'\sSONAME\s+([^\s]+)', data)
rv = f.close()
if rv == 10:
raise OSError, 'objdump command not found'
res = re.search(r'\sSONAME\s+([^\s]+)', dump)
if not res:
return None
return res.group(1)
......
......@@ -77,6 +77,9 @@ Core and Builtins
Library
-------
- Issue #12045: Avoid duplicate execution of command in ctypes.util._get_soname().
Patch by Sijin Joseph.
- Issue #26960: Backported #16270 from Python 3 to Python 2, to prevent urllib
from hanging when retrieving certain FTP files.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment