Close subprocess pipes to clear ResourceWarning messages in debug mode.
diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py
index f40a676..4cadcf7 100644
--- a/Lib/test/script_helper.py
+++ b/Lib/test/script_helper.py
@@ -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(
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 0ddc813..e8f8c9d 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -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)