diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-05-02 17:39:19 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-05-02 17:39:19 +0000 |
commit | f5f861e3e123639c08b37da69697d7e669ec35a9 (patch) | |
tree | e424f3fa30a53a2ebc6c403230e7dfbc0f89a204 /Lib/os.py | |
parent | 3920cf906c9a63ad110a8abf31ab4dcc65484c51 (diff) | |
download | cpython-f5f861e3e123639c08b37da69697d7e669ec35a9.tar.gz |
Patch 550804: Make os.environ.copy() return a copy.
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) |