Fixed #17923 -- Added missing import in the MySQL and Oracle backends. Thanks aldaran for the report. Also removed two duplicate imports.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17758 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e57bedee78
commit
8d71734f15
|
@ -7,6 +7,7 @@ Requires MySQLdb: http://sourceforge.net/projects/mysql-python
|
||||||
import datetime
|
import datetime
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import MySQLdb as Database
|
import MySQLdb as Database
|
||||||
|
@ -39,8 +40,7 @@ from django.utils import timezone
|
||||||
# Raise exceptions for database warnings if DEBUG is on
|
# Raise exceptions for database warnings if DEBUG is on
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
from warnings import filterwarnings
|
warnings.filterwarnings("error", category=Database.Warning)
|
||||||
filterwarnings("error", category=Database.Warning)
|
|
||||||
|
|
||||||
DatabaseError = Database.DatabaseError
|
DatabaseError = Database.DatabaseError
|
||||||
IntegrityError = Database.IntegrityError
|
IntegrityError = Database.IntegrityError
|
||||||
|
|
|
@ -8,6 +8,7 @@ Requires cx_Oracle: http://cx-oracle.sourceforge.net/
|
||||||
import datetime
|
import datetime
|
||||||
import decimal
|
import decimal
|
||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
|
||||||
def _setup_environment(environ):
|
def _setup_environment(environ):
|
||||||
|
|
|
@ -110,7 +110,6 @@ else:
|
||||||
class CompatCookie(SimpleCookie):
|
class CompatCookie(SimpleCookie):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(CompatCookie, self).__init__(*args, **kwargs)
|
super(CompatCookie, self).__init__(*args, **kwargs)
|
||||||
import warnings
|
|
||||||
warnings.warn("CompatCookie is deprecated. Use django.http.SimpleCookie instead.", DeprecationWarning)
|
warnings.warn("CompatCookie is deprecated. Use django.http.SimpleCookie instead.", DeprecationWarning)
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
Loading…
Reference in New Issue