]> granicus.if.org Git - python/commitdiff
Close subprocess pipes to clear ResourceWarning messages in debug mode.
authorBrian Curtin <brian.curtin@gmail.com>
Mon, 1 Nov 2010 14:00:33 +0000 (14:00 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Mon, 1 Nov 2010 14:00:33 +0000 (14:00 +0000)
Lib/test/script_helper.py
Lib/test/test_cmd_line.py

index f40a676c7accafd1476c2130bba5e91442f29701..4cadcf719677b4c76014bcf7113b0385f61e7bb4 100644 (file)
@@ -24,6 +24,8 @@ def _assert_python(expected_success, *args):
         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(
index 0ddc8131f686b7e2656565c48ca0e40982ab6231..e8f8c9d6269bd4eefdaa0134ae9d8a48bc1036cc 100644 (file)
@@ -231,6 +231,7 @@ sys.stdout.buffer.write(path)"""
             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)