PY3.E0701
Bad except order
Used when except clauses are not in the correct order (from the more specific to the more generic). If you don't fix the order, some exceptions may not be caught by the most specific handler.
Noncompliant Code:
Copy
try:
# if the line below raises TypeError then this won't reach
# never by block with this exception and will be caught by Exception
print(int(input()))
except Exception:
raise
except TypeError:
raise
Compliant Code:
Copy
try:
print(int(input()))
except TypeError:
raise
except Exception:
raise