summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-12-21 22:19:08 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-12-21 22:19:08 (GMT)
commit9014560412a2bd322170902a42ab965eee4b0c47 (patch)
tree367e3b3761c6a34e1d65259214517b5eb4e85181 /Lib
parent435f648584aacd5ac35ab6f278484b477ac4496f (diff)
downloadcpython-9014560412a2bd322170902a42ab965eee4b0c47.zip
cpython-9014560412a2bd322170902a42ab965eee4b0c47.tar.gz
cpython-9014560412a2bd322170902a42ab965eee4b0c47.tar.bz2
Make sure the UserDict copies do not share the same underlying
dictionary as the original. This parallels MvL's change to Lib/os.py 1.56. Backport candidate.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/UserDict.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/UserDict.py b/Lib/UserDict.py
index 35f86fc..8141e7f 100644
--- a/Lib/UserDict.py
+++ b/Lib/UserDict.py
@@ -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: