flake8: fix E722 do not use bare 'except'
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Wed, 13 Feb 2019 17:15:44 +0100
changeset 844 241520f99bca
parent 843 8cd02e8372be
child 845 15634db57820
flake8: fix E722 do not use bare 'except'
rql/nodes.py
rql/stmts.py
test/unittest_parser.py
test/unittest_stcheck.py
--- a/rql/nodes.py	Wed Feb 13 17:12:08 2019 +0100
+++ b/rql/nodes.py	Wed Feb 13 17:15:44 2019 +0100
@@ -1004,7 +1004,7 @@
                 try:
                     lhstype = rel.children[0].get_type(solution, kwargs)
                     return schema.eschema(lhstype).destination(rel.r_type)
-                except: # CoertionError, AssertionError :(
+                except Exception:  # CoertionError, AssertionError :(
                     pass
         return 'Any'
 
--- a/rql/stmts.py	Wed Feb 13 17:12:08 2019 +0100
+++ b/rql/stmts.py	Wed Feb 13 17:15:44 2019 +0100
@@ -119,7 +119,7 @@
         """
         try:
             return self.defined_vars[name]
-        except:
+        except Exception:
             self.defined_vars[name] = var = nodes.Variable(name)
             var.stmt = self
             return var
@@ -167,7 +167,7 @@
                    if vref.stmt is self]
         try:
             _check_references(defined, varrefs)
-        except:
+        except Exception:
             print(repr(self))
             raise
         return True
--- a/test/unittest_parser.py	Wed Feb 13 17:12:08 2019 +0100
+++ b/test/unittest_parser.py	Wed Feb 13 17:15:44 2019 +0100
@@ -347,7 +347,7 @@
     def parse(self, string, print_errors=False):
         try:
             return parse(string, print_errors)
-        except:
+        except Exception:
             raise
 
 
--- a/test/unittest_stcheck.py	Wed Feb 13 17:12:08 2019 +0100
+++ b/test/unittest_stcheck.py	Wed Feb 13 17:15:44 2019 +0100
@@ -98,7 +98,7 @@
     def _test(self, rql):
         try:
             self.assertRaises(BadRQLQuery, self.parse, rql)
-        except:
+        except Exception:
             print(rql)
             raise