]> granicus.if.org Git - python/commitdiff
Patch 550804: Make os.environ.copy() return a copy.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 2 May 2002 17:39:19 +0000 (17:39 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 2 May 2002 17:39:19 +0000 (17:39 +0000)
Lib/os.py

index e19883b708d3e9a7155209f99ba794de6f3d3d98..59f63e2dd86c1bff45d87a846ea4b36bcef1f5d2 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -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)