[Python-checkins] cpython (3.2): Fix ResourceWarnings in test_subprocess.

nadeem.vawda python-checkins at python.org
Fri Aug 19 05:22:40 CEST 2011


http://hg.python.org/cpython/rev/f6b0c794495a
changeset: 71913:f6b0c794495a
branch: 3.2
parent: 71910:122f952add3c
user: Nadeem Vawda <nadeem.vawda at gmail.com>
date: Fri Aug 19 05:12:01 2011 +0200
summary:
 Fix ResourceWarnings 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
@@ -1404,6 +1404,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
@@ -1421,6 +1423,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

AltStyle によって変換されたページ (->オリジナル) /