Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #12458 -- no longer use try/except/finally syntax in PostGIS an…

…d SpatiaLite backends as it's incompatible with Python 2.4. Thanks, knutin, for bug report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12026 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ca64e9d85f5b08d7deddbf521100e65515edb4de 1 parent 2b9d216
@jbronn jbronn authored
View
11 django/contrib/gis/db/backends/postgis/operations.py
@@ -404,11 +404,12 @@ def _get_postgis_func(self, func):
"""
cursor = self.connection._cursor()
try:
- cursor.execute('SELECT %s()' % func)
- row = cursor.fetchone()
- except:
- # Responsibility of callers to perform error handling.
- raise
+ try:
+ cursor.execute('SELECT %s()' % func)
+ row = cursor.fetchone()
+ except:
+ # Responsibility of callers to perform error handling.
+ raise
finally:
cursor.close()
return row[0]
View
11 django/contrib/gis/db/backends/spatialite/operations.py
@@ -211,11 +211,12 @@ def _get_spatialite_func(self, func):
"""
cursor = self.connection._cursor()
try:
- cursor.execute('SELECT %s()' % func)
- row = cursor.fetchone()
- except:
- # TODO: raise helpful exception here.
- raise
+ try:
+ cursor.execute('SELECT %s()' % func)
+ row = cursor.fetchone()
+ except:
+ # Responsibility of caller to perform error handling.
+ raise
finally:
cursor.close()
return row[0]
Please sign in to comment.
Something went wrong with that request. Please try again.