From 8d71734f1573fb9ea657ac16c2b31fdb43d78ac6 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 17 Mar 2012 09:11:24 +0000 Subject: [PATCH] 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 --- django/db/backends/mysql/base.py | 4 ++-- django/db/backends/oracle/base.py | 1 + django/http/__init__.py | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index e30cb90a93..faaefca06b 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -7,6 +7,7 @@ Requires MySQLdb: http://sourceforge.net/projects/mysql-python import datetime import re import sys +import warnings try: import MySQLdb as Database @@ -39,8 +40,7 @@ from django.utils import timezone # Raise exceptions for database warnings if DEBUG is on from django.conf import settings if settings.DEBUG: - from warnings import filterwarnings - filterwarnings("error", category=Database.Warning) + warnings.filterwarnings("error", category=Database.Warning) DatabaseError = Database.DatabaseError IntegrityError = Database.IntegrityError diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 6bc6e1dd9d..fc02ac41b2 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -8,6 +8,7 @@ Requires cx_Oracle: http://cx-oracle.sourceforge.net/ import datetime import decimal import sys +import warnings def _setup_environment(environ): diff --git a/django/http/__init__.py b/django/http/__init__.py index 60a92d5f1c..0c746fe74f 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -110,7 +110,6 @@ else: class CompatCookie(SimpleCookie): def __init__(self, *args, **kwargs): super(CompatCookie, self).__init__(*args, **kwargs) - import warnings warnings.warn("CompatCookie is deprecated. Use django.http.SimpleCookie instead.", DeprecationWarning) from django.conf import settings