Patch 550804: Make os.environ.copy() return a copy.

This commit is contained in:
Martin v. Löwis 2002-05-02 17:39:19 +00:00
parent e0e890a4da
commit a066f46b9b
1 changed files with 4 additions and 0 deletions

View File

@ -412,6 +412,8 @@ else:
def update(self, dict):
for k, v in dict.items():
self[k] = v
def copy(self):
return dict(self)
else: # Where Env Var Names Can Be Mixed Case
class _Environ(UserDict.UserDict):
@ -432,6 +434,8 @@ else:
def __delitem__(self, key):
unsetenv(key)
del self.data[key]
def copy(self):
return dict(self)
environ = _Environ(environ)