Follow the same convention as the rest of the file.
Still cleanup after [16708] git-svn-id: http://code.djangoproject.com/svn/django/trunk@16710 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
0037ca44d6
commit
93f92635b6
|
@ -19,7 +19,6 @@ from django.utils.log import getLogger
|
||||||
try:
|
try:
|
||||||
import psycopg2 as Database
|
import psycopg2 as Database
|
||||||
import psycopg2.extensions
|
import psycopg2.extensions
|
||||||
import psycopg2.Error
|
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
|
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
|
||||||
|
@ -125,7 +124,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
||||||
try:
|
try:
|
||||||
self.connection.close()
|
self.connection.close()
|
||||||
self.connection = None
|
self.connection = None
|
||||||
except psycopg2.Error:
|
except Database.Error:
|
||||||
# In some cases (database restart, network connection lost etc...)
|
# In some cases (database restart, network connection lost etc...)
|
||||||
# the connection to the database is lost without giving Django a
|
# the connection to the database is lost without giving Django a
|
||||||
# notification. If we don't set self.connection to None, the error
|
# notification. If we don't set self.connection to None, the error
|
||||||
|
|
Loading…
Reference in New Issue