diff options
| author | Aymeric Augustin <aymeric.augustin@polyconseil.fr> | 2012-05-03 15:27:01 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@polyconseil.fr> | 2012-05-03 15:27:01 +0200 |
| commit | e84f79f05113f546810c1908c7baef99fb1e874a (patch) | |
| tree | 4cb5f3e428caa894bd9acc06fc3cd6250b018715 /django/utils | |
| parent | 227cec686e512412f613c3d14743b85445765d92 (diff) | |
Fixed #18042 -- Advanced deprecation warnings.
Thanks Ramiro for the patch.
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/copycompat.py | 2 | ||||
| -rw-r--r-- | django/utils/hashcompat.py | 2 | ||||
| -rw-r--r-- | django/utils/itercompat.py | 6 | ||||
| -rw-r--r-- | django/utils/text.py | 4 |
4 files changed, 6 insertions, 8 deletions
diff --git a/django/utils/copycompat.py b/django/utils/copycompat.py index bd1a761f8a..6ccf6c3ae5 100644 --- a/django/utils/copycompat.py +++ b/django/utils/copycompat.py @@ -7,7 +7,7 @@ import types import warnings warnings.warn("django.utils.copycompat is deprecated; use the native copy module instead", - PendingDeprecationWarning) + DeprecationWarning) # Monkeypatch copy's deepcopy registry to handle functions correctly. if (hasattr(copy, '_deepcopy_dispatch') and types.FunctionType not in copy._deepcopy_dispatch): diff --git a/django/utils/hashcompat.py b/django/utils/hashcompat.py index b11fa0a686..62b1dfd12b 100644 --- a/django/utils/hashcompat.py +++ b/django/utils/hashcompat.py @@ -6,7 +6,7 @@ interface to the md5 and sha constructors, depending on system version. import warnings warnings.warn("django.utils.hashcompat is deprecated; use hashlib instead", - PendingDeprecationWarning) + DeprecationWarning) import hashlib md5_constructor = hashlib.md5 diff --git a/django/utils/itercompat.py b/django/utils/itercompat.py index dd47b7df24..2f016b1c3f 100644 --- a/django/utils/itercompat.py +++ b/django/utils/itercompat.py @@ -18,18 +18,16 @@ def is_iterable(x): return True def product(*args, **kwds): - # PendingDeprecationWarning in 1.5, remove this comment when the Deprecations - # will have been advanced for 1.5 warnings.warn("django.utils.itercompat.product is deprecated; use the native version instead", PendingDeprecationWarning) return itertools.product(*args, **kwds) def all(iterable): warnings.warn("django.utils.itercompat.all is deprecated; use the native version instead", - PendingDeprecationWarning) + DeprecationWarning) return __builtin__.all(iterable) def any(iterable): warnings.warn("django.utils.itercompat.any is deprecated; use the native version instead", - PendingDeprecationWarning) + DeprecationWarning) return __builtin__.any(iterable) diff --git a/django/utils/text.py b/django/utils/text.py index 606b15c0ce..f443b31a67 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -206,14 +206,14 @@ class Truncator(SimpleLazyObject): def truncate_words(s, num, end_text='...'): warnings.warn('This function has been deprecated. Use the Truncator class ' - 'in django.utils.text instead.', category=PendingDeprecationWarning) + 'in django.utils.text instead.', category=DeprecationWarning) truncate = end_text and ' %s' % end_text or '' return Truncator(s).words(num, truncate=truncate) truncate_words = allow_lazy(truncate_words, unicode) def truncate_html_words(s, num, end_text='...'): warnings.warn('This function has been deprecated. Use the Truncator class ' - 'in django.utils.text instead.', category=PendingDeprecationWarning) + 'in django.utils.text instead.', category=DeprecationWarning) truncate = end_text and ' %s' % end_text or '' return Truncator(s).words(num, truncate=truncate, html=True) truncate_html_words = allow_lazy(truncate_html_words, unicode) |
