diff --git a/nova/hacking/checks.py b/nova/hacking/checks.py index 88dcd0a7e664..b085797e6ed2 100644 --- a/nova/hacking/checks.py +++ b/nova/hacking/checks.py @@ -31,29 +31,6 @@ def import_no_db_in_virt(logical_line, filename): yield (0, "N307: nova.db import not allowed in nova/virt/*") -def except_python3x_compatible(logical_line, filename): - """Check for except statements to be Python 3.x compatible - - As of Python 3.x, the construct "except x,y:" has been removed. - - N308 - """ - - def is_old_style_except(logical_line): - # Should match: - # except ProcessExecutionError, exn: - # Should not match: - # except UncodeError: - # except (x,y): - return (',' in logical_line - and ')' not in logical_line.rpartition(',')[2]) - - if ("except " in logical_line - and logical_line.endswith(':') - and is_old_style_except(logical_line)): - yield(0, "N308: Python 3.x incompatible 'except x,y:' construct") - - def no_db_session_in_public_api(logical_line, filename): if "db/api.py" in filename or "db/sqlalchemy/api.py" in filename: if session_check.match(logical_line): @@ -72,6 +49,5 @@ def use_timeutils_utcnow(logical_line): def factory(register): register(import_no_db_in_virt) - register(except_python3x_compatible) register(no_db_session_in_public_api) register(use_timeutils_utcnow)