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.
This commit is contained in:
Raymond Hettinger 2003-12-21 22:19:08 +00:00
parent 435f648584
commit 9014560412

View 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: