summaryrefslogtreecommitdiff
path: root/django/contrib/gis/utils/layermapping.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-04-28 18:09:37 +0200
committerClaude Paroz <claude@2xlibre.net>2012-04-29 20:57:15 +0200
commit3904b74a3f2f92fefe1d39281ed683c52f2fef03 (patch)
tree1ae8f65371ed53df205553f41c9d0f90d1e9fee9 /django/contrib/gis/utils/layermapping.py
parenteefb00f30124f775ca52258ccd8549054fe8230f (diff)
Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
Diffstat (limited to 'django/contrib/gis/utils/layermapping.py')
-rw-r--r--django/contrib/gis/utils/layermapping.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/gis/utils/layermapping.py b/django/contrib/gis/utils/layermapping.py
index 154617f0b9..ea3f3d7861 100644
--- a/django/contrib/gis/utils/layermapping.py
+++ b/django/contrib/gis/utils/layermapping.py
@@ -430,7 +430,7 @@ class LayerMapping(object):
# Creating the CoordTransform object
return CoordTransform(self.source_srs, target_srs)
- except Exception, msg:
+ except Exception as msg:
raise LayerMapError('Could not translate between the data source and model geometry: %s' % msg)
def geometry_field(self):
@@ -514,7 +514,7 @@ class LayerMapping(object):
# Getting the keyword arguments
try:
kwargs = self.feature_kwargs(feat)
- except LayerMapError, msg:
+ except LayerMapError as msg:
# Something borked the validation
if strict: raise
elif not silent:
@@ -553,7 +553,7 @@ class LayerMapping(object):
if verbose: stream.write('%s: %s\n' % (is_update and 'Updated' or 'Saved', m))
except SystemExit:
raise
- except Exception, msg:
+ except Exception as msg:
if self.transaction_mode == 'autocommit':
# Rolling back the transaction so that other model saves
# will work.