diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/UserDict.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/UserDict.py b/Lib/UserDict.py index b806ac1..b78860f 100644 --- a/Lib/UserDict.py +++ b/Lib/UserDict.py @@ -19,7 +19,14 @@ class UserDict: if self.__class__ is UserDict: return UserDict(self.data) import copy - return copy.copy(self) + data = self.data + try: + self.data = {} + c = copy.copy(self) + finally: + self.data = data + c.update(self) + return c def keys(self): return self.data.keys() def items(self): return self.data.items() def iteritems(self): return self.data.iteritems() |