diff options
| author | Brian Curtin <brian.curtin@gmail.com> | 2010-11-01 14:00:33 +0000 |
|---|---|---|
| committer | Brian Curtin <brian.curtin@gmail.com> | 2010-11-01 14:00:33 +0000 |
| commit | c4ac887917e4b5d97ff1d761c68a52722044213c (patch) | |
| tree | dba9595189d846f3e6ac44bfa47669f5d6ae3ae7 /Lib/test | |
| parent | 1f1c247adb974fe7f6ed0fa106884a95d031d622 (diff) | |
| download | cpython-git-c4ac887917e4b5d97ff1d761c68a52722044213c.tar.gz | |
Close subprocess pipes to clear ResourceWarning messages in debug mode.
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/script_helper.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_cmd_line.py | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py index f40a676c7a..4cadcf7196 100644 --- a/Lib/test/script_helper.py +++ b/Lib/test/script_helper.py @@ -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( diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 0ddc8131f6..e8f8c9d626 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -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) |
