summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes/util.py
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2009-09-18 13:59:58 (GMT)
committerEric Smith <eric@trueblade.com>2009-09-18 13:59:58 (GMT)
commit53cda5312a36c08cf93a63cc865aa3052cf0fff1 (patch)
tree17ea001d3f24509f63c5269dc5bb6ab59fd300b6 /Lib/ctypes/util.py
parent182dffae353ee263d320745e1789a4a780a5fb7d (diff)
downloadcpython-53cda5312a36c08cf93a63cc865aa3052cf0fff1.zip
cpython-53cda5312a36c08cf93a63cc865aa3052cf0fff1.tar.gz
cpython-53cda5312a36c08cf93a63cc865aa3052cf0fff1.tar.bz2
Merged revisions 74907 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r74907 | eric.smith | 2009-09-18 09:23:13 -0400 (Fri, 18 Sep 2009) | 1 line Issue #6882: Import uuid creates zombies processes. I used a slightly different patch than the one attached to the issue, to be consistent with the style in the rest of the module. ........
Diffstat (limited to 'Lib/ctypes/util.py')
-rw-r--r--Lib/ctypes/util.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 794b895..1bd2d70 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -219,8 +219,12 @@ elif os.name == "posix":
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \
% (abi_type, re.escape(name))
- res = re.search(expr,
- os.popen('/sbin/ldconfig -p 2>/dev/null').read())
+ f = os.popen('/sbin/ldconfig -p 2>/dev/null')
+ try:
+ data = f.read()
+ finally:
+ f.close()
+ res = re.search(expr, data)
if not res:
return None
return res.group(1)