Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings

Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
This commit is contained in:
Claude Paroz 2014-02-26 22:48:20 +01:00
parent 70ec4d776e
commit 210d0489c5
84 changed files with 287 additions and 189 deletions

View file

@ -6,6 +6,7 @@ from gzip import GzipFile
from io import BytesIO
import warnings
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.encoding import force_text
from django.utils.functional import allow_lazy, SimpleLazyObject
from django.utils import six
@ -332,7 +333,7 @@ def javascript_quote(s, quote_double_quotes=False):
"django.utils.text.javascript_quote() is deprecated. "
"Use django.utils.html.escapejs() instead."
)
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
warnings.warn(msg, RemovedInDjango19Warning, stacklevel=2)
def fix(match):
return "\\u%04x" % ord(match.group(1))