mirror of
https://github.com/django/django.git
synced 2025-09-12 13:36:31 +00:00
Removed DatabaseError and IntegrityError declarations from database backends.
Unused since 11ee9746a0
.
This commit is contained in:
parent
6fe846a8f0
commit
85f2bba7eb
5 changed files with 4 additions and 25 deletions
|
@ -44,9 +44,6 @@ from .schema import DatabaseSchemaEditor # NOQA isort:skip
|
|||
from .utils import utc_tzinfo_factory # NOQA isort:skip
|
||||
from .version import get_version # NOQA isort:skip
|
||||
|
||||
DatabaseError = Database.DatabaseError
|
||||
IntegrityError = Database.IntegrityError
|
||||
|
||||
if six.PY2:
|
||||
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
|
||||
psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY)
|
||||
|
@ -239,7 +236,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
|||
nodb_connection = super(DatabaseWrapper, self)._nodb_connection
|
||||
try:
|
||||
nodb_connection.ensure_connection()
|
||||
except (DatabaseError, WrappedDatabaseError):
|
||||
except (Database.DatabaseError, WrappedDatabaseError):
|
||||
warnings.warn(
|
||||
"Normally Django will use a connection to the 'postgres' database "
|
||||
"to avoid running initialization queries against the production "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue