From: Raymond Hettinger Date: Sun, 21 Dec 2003 22:19:08 +0000 (+0000) Subject: Make sure the UserDict copies do not share the same underlying X-Git-Tag: v2.4a1~1061 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9014560412a2bd322170902a42ab965eee4b0c47;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/UserDict.py b/Lib/UserDict.py index 35f86fc4dc10..8141e7f31be8 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: