diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2012-07-24 07:01:57 -0700 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2012-07-24 07:01:57 -0700 |
| commit | 38ce709fe44ebf37e6c8531451eab98fe0a552a0 (patch) | |
| tree | 8c8b0038171d3e75393cd8d7c042b7c5a10b0eaa /django | |
| parent | ae4125ffce6c0a82e9016f67d60d31bc7595887c (diff) | |
Added tests for deprecation warnings and fixed the argument order for the warnings.
Diffstat (limited to 'django')
| -rw-r--r-- | django/utils/datastructures.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index 16741ba36b..41b43b286c 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -196,14 +196,18 @@ class SortedDict(dict): # This, and insert() are deprecated because they cannot be implemented # using collections.OrderedDict (Python 2.7 and up), which we'll # eventually switch to - warnings.warn(PendingDeprecationWarning, - "SortedDict.value_for_index is deprecated", stacklevel=2) + warnings.warn( + "SortedDict.value_for_index is deprecated", PendingDeprecationWarning, + stacklevel=2 + ) return self[self.keyOrder[index]] def insert(self, index, key, value): """Inserts the key, value pair before the item with the given index.""" - warnings.warn(PendingDeprecationWarning, - "SortedDict.insert is deprecated", stacklevel=2) + warnings.warn( + "SortedDict.insert is deprecated", PendingDeprecationWarning, + stacklevel=2 + ) if key in self.keyOrder: n = self.keyOrder.index(key) del self.keyOrder[n] |
