Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Justin Bronn authored December 29, 2009
11  django/contrib/gis/db/backends/postgis/operations.py
@@ -404,11 +404,12 @@ def _get_postgis_func(self, func):
404 404
         """
405 405
         cursor = self.connection._cursor()
406 406
         try:
407  
-            cursor.execute('SELECT %s()' % func)
408  
-            row = cursor.fetchone()
409  
-        except:
410  
-            # Responsibility of callers to perform error handling.
411  
-            raise
  407
+            try:
  408
+                cursor.execute('SELECT %s()' % func)
  409
+                row = cursor.fetchone()
  410
+            except:
  411
+                # Responsibility of callers to perform error handling.
  412
+                raise
412 413
         finally:
413 414
             cursor.close()
414 415
         return row[0]
11  django/contrib/gis/db/backends/spatialite/operations.py
@@ -211,11 +211,12 @@ def _get_spatialite_func(self, func):
211 211
         """
212 212
         cursor = self.connection._cursor()
213 213
         try:
214  
-            cursor.execute('SELECT %s()' % func)
215  
-            row = cursor.fetchone()
216  
-        except:
217  
-            # TODO: raise helpful exception here.
218  
-            raise
  214
+            try:
  215
+                cursor.execute('SELECT %s()' % func)
  216
+                row = cursor.fetchone()
  217
+            except:
  218
+                # Responsibility of caller to perform error handling.
  219
+                raise
219 220
         finally:
220 221
             cursor.close()
221 222
         return row[0]

0 notes on commit ca64e9d

Please sign in to comment.
Something went wrong with that request. Please try again.