Ticket #16722: psycopg2_import_error.diff
File psycopg2_import_error.diff, 939 bytes (added by , 13 years ago) |
---|
-
django/db/backends/postgresql_psycopg2/base.py
19 19 try: 20 20 import psycopg2 as Database 21 21 import psycopg2.extensions 22 import psycopg2.Error23 22 except ImportError, e: 24 23 from django.core.exceptions import ImproperlyConfigured 25 24 raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e) … … 125 124 try: 126 125 self.connection.close() 127 126 self.connection = None 128 except psycopg2.Error:127 except Database.Error: 129 128 # In some cases (database restart, network connection lost etc...) 130 129 # the connection to the database is lost without giving Django a 131 130 # notification. If we don't set self.connection to None, the error