Add a useful stacklevel to some RemovedInDjango19Warnings

This commit is contained in:
Chris Beaven 2014-03-27 15:43:31 +13:00
parent bf2b0affe4
commit b077ba7ac1
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