[Python-checkins] cpython (2.7): Fix resource leaks in test_subprocess.
nadeem.vawda
python-checkins at python.org
Fri Aug 19 05:22:41 CEST 2011
http://hg.python.org/cpython/rev/e7fe0c05d722
changeset: 71915:e7fe0c05d722
branch: 2.7
parent: 71912:5333ed548257
user: Nadeem Vawda <nadeem.vawda at gmail.com>
date: Fri Aug 19 05:22:24 2011 +0200
summary:
Fix resource leaks in test_subprocess.
files:
Lib/test/test_subprocess.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -955,6 +955,8 @@
'time.sleep(0.2)'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
ident = id(p)
pid = p.pid
del p
@@ -972,6 +974,8 @@
'time.sleep(3)'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
ident = id(p)
pid = p.pid
del p
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list