diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-04-30 17:50:22 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-04-30 17:50:22 +0200 |
| commit | 3d842a0a94e413185b9abb87e7b3da7c27b6d7ad (patch) | |
| tree | 2f1c593bf665570899097836cbbb4091457b72e1 /django/utils | |
| parent | e4d4cb6130b046d145ab1069df0c04d78786eedd (diff) | |
| parent | 4b11762f7d7aed2f4f36c4158326c0a4332038f9 (diff) | |
Merge branch 'master' of github.com:django/django
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/_os.py | 2 | ||||
| -rw-r--r-- | django/utils/datastructures.py | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/django/utils/_os.py b/django/utils/_os.py index ad4efb3264..884689fefc 100644 --- a/django/utils/_os.py +++ b/django/utils/_os.py @@ -61,7 +61,7 @@ def rmtree_errorhandler(func, path, exc_info): continue without problems. """ exctype, value = exc_info[:2] - # lookin for a windows error + # looking for a windows error if exctype is not WindowsError or 'Access is denied' not in str(value): raise # file type should currently be read only diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index 09d37518e0..f7042f7061 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -128,6 +128,12 @@ class SortedDict(dict): return self.__class__([(key, copy.deepcopy(value, memo)) for key, value in self.iteritems()]) + def __copy__(self): + # The Python's default copy implementation will alter the state + # of self. The reason for this seems complex but is likely related to + # subclassing dict. + return self.copy() + def __setitem__(self, key, value): if key not in self: self.keyOrder.append(key) @@ -200,9 +206,7 @@ class SortedDict(dict): def copy(self): """Returns a copy of this object.""" # This way of initializing the copy means it works for subclasses, too. - obj = self.__class__(self) - obj.keyOrder = self.keyOrder[:] - return obj + return self.__class__(self) def __repr__(self): """ |
