From fd4903bf05705d73c8b97d945a50e4e03abad729 Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Sat, 17 Oct 2009 15:45:52 +0000 Subject: [PATCH] Move restoration of the os.environ object into the context manager where it belongs --- Lib/test/test_httpservers.py | 1 - Lib/test/test_support.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 73354e3954..3ec014018b 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -60,7 +60,6 @@ class BaseTestCase(unittest.TestCase): self.lock.release() self.thread.stop() os.environ.__exit__() - os.environ = os.environ._environ def request(self, uri, method='GET', body=None, headers={}): self.connection = httplib.HTTPConnection('localhost', self.PORT) diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 2f3a3784b3..048c527db9 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -576,6 +576,7 @@ class EnvironmentVarGuard(UserDict.DictMixin): del self._environ[k] else: self._environ[k] = v + os.environ = self._environ class DirsOnSysPath(object): -- 2.40.0