]> granicus.if.org Git - python/commitdiff
Make sure the UserDict copies do not share the same underlying
authorRaymond Hettinger <python@rcn.com>
Sun, 21 Dec 2003 22:19:08 +0000 (22:19 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 21 Dec 2003 22:19:08 +0000 (22:19 +0000)
dictionary as the original.  This parallels MvL's change to
Lib/os.py 1.56.

Backport candidate.

Lib/UserDict.py

index 35f86fc4dc1076ad0eeeb862e44d290552657297..8141e7f31be8b9a2086522d2bbd47df663bb6169 100644 (file)
@@ -22,7 +22,7 @@ class UserDict:
     def clear(self): self.data.clear()
     def copy(self):
         if self.__class__ is UserDict:
-            return UserDict(self.data)
+            return UserDict(self.data.copy())
         import copy
         data = self.data
         try: