summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2009-09-18 13:23:13 (GMT)
committerEric Smith <eric@trueblade.com>2009-09-18 13:23:13 (GMT)
commit81fd8040341a991b482bf3fecec454286274ef79 (patch)
tree26723a984a3127a643c0d2e94ce3fd7f43e12527 /Lib
parent16df8c93ce11464ccb01862c551b769b3e3318be (diff)
downloadcpython-81fd8040341a991b482bf3fecec454286274ef79.zip
cpython-81fd8040341a991b482bf3fecec454286274ef79.tar.gz
cpython-81fd8040341a991b482bf3fecec454286274ef79.tar.bz2
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')
-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)