Commit 20472aa8 authored by Baptiste Mispelon's avatar Baptiste Mispelon
Browse files

Fixed #21189: Cleaned up usage of bare except clauses.

Thanks to berkerpeksag for the report and to claudep
for the review.
parent 948d209a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ class FlatpageFallbackMiddleware(object):
        # is a middleware, we can't assume the errors will be caught elsewhere.
        except Http404:
            return response
        except:
        except Exception:
            if settings.DEBUG:
                raise
            return response
+1 −1
Original line number Diff line number Diff line
@@ -345,5 +345,5 @@ class SpatialRefSysMixin(object):
        """
        try:
            return six.text_type(self.srs)
        except:
        except Exception:
            return six.text_type(self.wkt)
+3 −6
Original line number Diff line number Diff line
@@ -238,15 +238,12 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
        """
        Helper routine for calling SpatiaLite functions and returning
        their result.
        Any error occuring in this method should be handled by the caller.
        """
        cursor = self.connection._cursor()
        try:
        try:
            cursor.execute('SELECT %s' % func)
            row = cursor.fetchone()
            except:
                # Responsibility of caller to perform error handling.
                raise
        finally:
            cursor.close()
        return row[0]
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ class GeometryField(forms.Field):
            elif self.srid != -1 and self.srid != geom.srid:
                try:
                    geom.transform(self.srid)
                except:
                except GEOSException:
                    raise forms.ValidationError(self.error_messages['transform_error'], code='transform_error')

        return geom
+1 −1
Original line number Diff line number Diff line
@@ -14,5 +14,5 @@
try:
    from .base import GeoIP, GeoIPException
    HAS_GEOIP = True
except:
except ImportError:
    HAS_GEOIP = False
Loading