Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made various negligible formatting cleanups to the database backends

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5983 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b367ec2244995c8efe1057671e0180d23664725f 1 parent 14db373
@adrianholovaty adrianholovaty authored
View
2  django/db/backends/ado_mssql/base.py
@@ -9,7 +9,7 @@
import adodbapi as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured, "Error loading adodbapi module: %s" % e
+ raise ImproperlyConfigured("Error loading adodbapi module: %s" % e)
import datetime
try:
import mx
View
2  django/db/backends/dummy/base.py
@@ -37,4 +37,4 @@ def __init__(self, **kwargs):
pass
def close(self):
- pass # close()
+ pass
View
4 django/db/backends/mysql/base.py
@@ -9,7 +9,7 @@
import MySQLdb as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e
+ raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
# We want version (1, 2, 1, 'final', 2) or later. We can't just use
# lexicographic ordering in this check because then (1, 2, 1, 'gamma')
@@ -17,7 +17,7 @@
version = Database.version_info
if (version < (1,2,1) or (version[:3] == (1, 2, 1) and
(len(version) < 5 or version[3] != 'final' or version[4] < 2))):
- raise ImportError, "MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__
+ raise ImportError("MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__)
from MySQLdb.converters import conversions
from MySQLdb.constants import FIELD_TYPE
View
6 django/db/backends/mysql_old/base.py
@@ -10,7 +10,7 @@
import MySQLdb as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e
+ raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
from MySQLdb.converters import conversions
from MySQLdb.constants import FIELD_TYPE
import types
@@ -48,14 +48,14 @@ def execute(self, sql, params=()):
return self.cursor.execute(sql, params)
except Database.Warning, w:
self.cursor.execute("SHOW WARNINGS")
- raise Database.Warning, "%s: %s" % (w, self.cursor.fetchall())
+ raise Database.Warning("%s: %s" % (w, self.cursor.fetchall()))
def executemany(self, sql, param_list):
try:
return self.cursor.executemany(sql, param_list)
except Database.Warning, w:
self.cursor.execute("SHOW WARNINGS")
- raise Database.Warning, "%s: %s" % (w, self.cursor.fetchall())
+ raise Database.Warning("%s: %s" % (w, self.cursor.fetchall()))
def __getattr__(self, attr):
if attr in self.__dict__:
View
6 django/db/backends/oracle/base.py
@@ -16,7 +16,7 @@
import cx_Oracle as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured, "Error loading cx_Oracle module: %s" % e
+ raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e)
DatabaseError = Database.Error
IntegrityError = Database.IntegrityError
@@ -113,9 +113,7 @@ def iterator(self):
except EmptyResultSet:
raise StopIteration
if not full_query:
- full_query = "SELECT %s%s\n%s" % \
- ((self._distinct and "DISTINCT " or ""),
- ', '.join(select), sql)
+ full_query = "SELECT %s%s\n%s" % ((self._distinct and "DISTINCT " or ""), ', '.join(select), sql)
cursor = connection.cursor()
cursor.execute(full_query, params)
View
6 django/db/backends/postgresql/base.py
@@ -11,7 +11,7 @@
import psycopg as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured, "Error loading psycopg module: %s" % e
+ raise ImproperlyConfigured("Error loading psycopg module: %s" % e)
DatabaseError = Database.DatabaseError
IntegrityError = Database.IntegrityError
@@ -85,7 +85,7 @@ def _cursor(self, settings):
set_tz = True
if settings.DATABASE_NAME == '':
from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured, "You need to specify DATABASE_NAME in your Django settings file."
+ raise ImproperlyConfigured("You need to specify DATABASE_NAME in your Django settings file.")
conn_string = "dbname=%s" % settings.DATABASE_NAME
if settings.DATABASE_USER:
conn_string = "user=%s %s" % (settings.DATABASE_USER, conn_string)
@@ -121,7 +121,7 @@ def typecast_string(s):
try:
Database.register_type(Database.new_type((1082,), "DATE", util.typecast_date))
except AttributeError:
- raise Exception, "You appear to be using psycopg version 2. Set your DATABASE_ENGINE to 'postgresql_psycopg2' instead of 'postgresql'."
+ raise Exception("You appear to be using psycopg version 2. Set your DATABASE_ENGINE to 'postgresql_psycopg2' instead of 'postgresql'.")
Database.register_type(Database.new_type((1083,1266), "TIME", util.typecast_time))
Database.register_type(Database.new_type((1114,1184), "TIMESTAMP", util.typecast_timestamp))
Database.register_type(Database.new_type((16,), "BOOLEAN", util.typecast_boolean))
View
4 django/db/backends/postgresql_psycopg2/base.py
@@ -11,7 +11,7 @@
import psycopg2.extensions
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured, "Error loading psycopg2 module: %s" % e
+ raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
DatabaseError = Database.DatabaseError
IntegrityError = Database.IntegrityError
@@ -47,7 +47,7 @@ def _cursor(self, settings):
set_tz = True
if settings.DATABASE_NAME == '':
from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured, "You need to specify DATABASE_NAME in your Django settings file."
+ raise ImproperlyConfigured("You need to specify DATABASE_NAME in your Django settings file.")
conn_string = "dbname=%s" % settings.DATABASE_NAME
if settings.DATABASE_USER:
conn_string = "user=%s %s" % (settings.DATABASE_USER, conn_string)
Please sign in to comment.
Something went wrong with that request. Please try again.