From 9014560412a2bd322170902a42ab965eee4b0c47 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 21 Dec 2003 22:19:08 +0000 Subject: [PATCH] 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. --- Lib/UserDict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/UserDict.py b/Lib/UserDict.py index 35f86fc4dc..8141e7f31b 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: -- 2.50.1