[Python-checkins] r86081 - in python/branches/py3k/Lib/test: script_helper.py test_cmd_line.py

brian.curtin python-checkins at python.org
Mon Nov 1 15:00:33 CET 2010


Author: brian.curtin
Date: Mon Nov  1 15:00:33 2010
New Revision: 86081

Log:
Close subprocess pipes to clear ResourceWarning messages in debug mode.


Modified:
   python/branches/py3k/Lib/test/script_helper.py
   python/branches/py3k/Lib/test/test_cmd_line.py

Modified: python/branches/py3k/Lib/test/script_helper.py
==============================================================================
--- python/branches/py3k/Lib/test/script_helper.py	(original)
+++ python/branches/py3k/Lib/test/script_helper.py	Mon Nov  1 15:00:33 2010
@@ -24,6 +24,8 @@
         out, err = p.communicate()
     finally:
         subprocess._cleanup()
+        p.stdout.close()
+        p.stderr.close()
     rc = p.returncode
     if (rc and expected_success) or (not rc and not expected_success):
         raise AssertionError(

Modified: python/branches/py3k/Lib/test/test_cmd_line.py
==============================================================================
--- python/branches/py3k/Lib/test/test_cmd_line.py	(original)
+++ python/branches/py3k/Lib/test/test_cmd_line.py	Mon Nov  1 15:00:33 2010
@@ -231,6 +231,7 @@
             code = '; '.join(code)
             p = _spawn_python_with_env('-S', '-c', code)
             stdout, _ = p.communicate()
+            p.stdout.close()
             self.assertIn(path1.encode('ascii'), stdout)
             self.assertIn(path2.encode('ascii'), stdout)
 


More information about the Python-checkins mailing list