From 7f4f8c3ff148e151e345253c8a607a1d5fe14d4d Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Mon, 2 Nov 2009 22:04:54 +0000 Subject: [PATCH] Try to fix test_wsgiref failures due to test_httpservers modifying the environment --- Lib/test/test_httpservers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 31321c3fa6..49474f6351 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -341,13 +341,17 @@ class CGIHTTPServerTestCase(BaseTestCase): def test_main(verbose=None): + cwd = os.getcwd() + env = os.environ.copy() try: - cwd = os.getcwd() test_support.run_unittest(BaseHTTPServerTestCase, SimpleHTTPServerTestCase, CGIHTTPServerTestCase ) finally: + test_support.reap_children() + os.environ.clear() + os.environ.update(env) os.chdir(cwd) if __name__ == '__main__': -- 2.50.1