diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-12-25 21:07:27 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-12-29 21:59:07 +0100 |
| commit | ef017a5f00d9e84059e00e8fea123be51b293f75 (patch) | |
| tree | ff0bf6ebfb015465e1ceee3d2551f1c7a200d07f /django/utils | |
| parent | 130829334c32f48b9ba6e6251d0e780c0d99cd4d (diff) | |
Advanced pending deprecation warnings.
Also added stacklevel argument, fixed #18127.
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/datastructures.py | 4 | ||||
| -rw-r--r-- | django/utils/encoding.py | 2 | ||||
| -rw-r--r-- | django/utils/itercompat.py | 2 | ||||
| -rw-r--r-- | django/utils/simplejson.py | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index f81fb88a19..64c218fe43 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -217,7 +217,7 @@ class SortedDict(dict): # using collections.OrderedDict (Python 2.7 and up), which we'll # eventually switch to warnings.warn( - "SortedDict.value_for_index is deprecated", PendingDeprecationWarning, + "SortedDict.value_for_index is deprecated", DeprecationWarning, stacklevel=2 ) return self[self.keyOrder[index]] @@ -225,7 +225,7 @@ class SortedDict(dict): def insert(self, index, key, value): """Inserts the key, value pair before the item with the given index.""" warnings.warn( - "SortedDict.insert is deprecated", PendingDeprecationWarning, + "SortedDict.insert is deprecated", DeprecationWarning, stacklevel=2 ) if key in self.keyOrder: diff --git a/django/utils/encoding.py b/django/utils/encoding.py index 15215849b2..68929cc0e5 100644 --- a/django/utils/encoding.py +++ b/django/utils/encoding.py @@ -36,7 +36,7 @@ class StrAndUnicode(object): def __init__(self, *args, **kwargs): warnings.warn("StrAndUnicode is deprecated. Define a __str__ method " "and apply the @python_2_unicode_compatible decorator " - "instead.", PendingDeprecationWarning, stacklevel=2) + "instead.", DeprecationWarning, stacklevel=2) super(StrAndUnicode, self).__init__(*args, **kwargs) if six.PY3: diff --git a/django/utils/itercompat.py b/django/utils/itercompat.py index fe8f8b9b46..e7ea326536 100644 --- a/django/utils/itercompat.py +++ b/django/utils/itercompat.py @@ -19,5 +19,5 @@ def is_iterable(x): def product(*args, **kwds): warnings.warn("django.utils.itercompat.product is deprecated; use the native version instead", - PendingDeprecationWarning) + DeprecationWarning, stacklevel=2) return itertools.product(*args, **kwds) diff --git a/django/utils/simplejson.py b/django/utils/simplejson.py index a851a4f8ef..d4032a6b34 100644 --- a/django/utils/simplejson.py +++ b/django/utils/simplejson.py @@ -9,7 +9,7 @@ from __future__ import absolute_import import warnings warnings.warn("django.utils.simplejson is deprecated; use json instead.", - PendingDeprecationWarning) + DeprecationWarning, stacklevel=2) try: import simplejson |
