Move restoration of the os.environ object into the context manager where it belongs

This commit is contained in:
Nick Coghlan 2009-10-17 15:45:52 +00:00
parent 87c03b3108
commit fd4903bf05
2 changed files with 1 additions and 1 deletions

View File

@ -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)

View File

@ -576,6 +576,7 @@ class EnvironmentVarGuard(UserDict.DictMixin):
del self._environ[k]
else:
self._environ[k] = v
os.environ = self._environ
class DirsOnSysPath(object):