From 901b60e7e195d23b0f66caa3ecab1299a2e15235 Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Fri, 29 Jan 2010 17:58:55 +0000 Subject: [PATCH] Now look for `DatabaseError` during PostGIS backend initialization, as it is now raised instead of a `ProgrammingError` after changes in r12352. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12354 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/gis/db/backends/postgis/operations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/django/contrib/gis/db/backends/postgis/operations.py b/django/contrib/gis/db/backends/postgis/operations.py index 29293523861..c4576a35748 100644 --- a/django/contrib/gis/db/backends/postgis/operations.py +++ b/django/contrib/gis/db/backends/postgis/operations.py @@ -8,7 +8,8 @@ from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.measure import Distance from django.core.exceptions import ImproperlyConfigured -from django.db.backends.postgresql_psycopg2.base import Database, DatabaseOperations +from django.db.backends.postgresql_psycopg2.base import DatabaseOperations +from django.db.utils import DatabaseError #### Classes used in constructing PostGIS spatial SQL #### class PostGISOperator(SpatialOperation): @@ -99,7 +100,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations): self.geom_func_prefix = prefix self.spatial_version = version - except Database.ProgrammingError: + except DatabaseError: raise ImproperlyConfigured('Cannot determine PostGIS version for database "%s". ' 'GeoDjango requires at least PostGIS version 1.3. ' 'Was the database created from a spatial database '