[1.7.x] Add a useful stacklevel to some RemovedInDjango19Warnings

Backport of b077ba7ac1 from master
This commit is contained in:
Chris Beaven 2014-03-27 15:43:31 +13:00 committed by Tim Graham
parent 4678efd3f1
commit fe61ba91c7
4 changed files with 6 additions and 4 deletions

View File

@ -4,6 +4,7 @@ from django.utils.deprecation import RemovedInDjango19Warning
warnings.warn(
"The django.contrib.gis.db.backends.util module has been renamed. "
"Use django.contrib.gis.db.backends.utils instead.", RemovedInDjango19Warning)
"Use django.contrib.gis.db.backends.utils instead.",
RemovedInDjango19Warning, stacklevel=2)
from django.contrib.gis.db.backends.utils import * # NOQA

View File

@ -4,6 +4,7 @@ from django.utils.deprecation import RemovedInDjango19Warning
warnings.warn(
"The django.db.backends.util module has been renamed. "
"Use django.db.backends.utils instead.", RemovedInDjango19Warning)
"Use django.db.backends.utils instead.", RemovedInDjango19Warning,
stacklevel=2)
from django.db.backends.utils import * # NOQA

View File

@ -4,6 +4,6 @@ from django.utils.deprecation import RemovedInDjango19Warning
warnings.warn(
"The django.forms.util module has been renamed. "
"Use django.forms.utils instead.", RemovedInDjango19Warning)
"Use django.forms.utils instead.", RemovedInDjango19Warning, stacklevel=2)
from django.forms.utils import * # NOQA

View File

@ -12,7 +12,7 @@ from django.utils.encoding import force_str, force_text, DEFAULT_LOCALE_ENCODING
warnings.warn(
"django.utils.tzinfo will be removed in Django 1.9. "
"Use django.utils.timezone instead.",
RemovedInDjango19Warning)
RemovedInDjango19Warning, stacklevel=2)
# Python's doc say: "A tzinfo subclass must have an __init__() method that can