[PATCH 8 of 9 Registration cube] [flake8] fix E722 do not use bare 'except'

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 12:50:11 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585737928 0
#      Wed Apr 01 10:45:28 2020 +0000
# Node ID 0c221b216fbe5dd7cc117523ff1db00dead46477
# Parent  1bd532f3da619c5be22bec4da455ed10e744bc50
[flake8] fix E722 do not use bare 'except'

diff --git a/cubicweb_registration/views.py b/cubicweb_registration/views.py
--- a/cubicweb_registration/views.py
+++ b/cubicweb_registration/views.py
@@ -140,7 +140,7 @@
                                   req.vreg.config['registration-cypher-seed'])
             login = data[qname('login')]
             password = data.pop(qname('upassword'))
-        except:
+        except Exception:
             msg = req._(u'Invalid registration data. Please try registering again.')
             raise Redirect(req.build_url(u'register', __message=msg))
         if self._cw.user.login == login:
@@ -177,7 +177,7 @@
             with cnx:
                 name = cnx.user.name()
             raise Redirect(self.success_redirect_url(name))
-        except:
+        except Exception:
             if err is not None:
                 # both registration and login failed, re-raise the previous
                 # ValidationError




More information about the cubicweb-devel mailing list