From b75c7e6b2584f9154fcb969ef6de2d5136c7f8fd Mon Sep 17 00:00:00 2001 From: "Dr. Jens Harbott" Date: Mon, 28 Mar 2022 08:35:43 +0200 Subject: [PATCH] Fix test errors with python3.10 Python3.10 has become more strict when parsing code that contains syntax errors, fix those. Signed-off-by: Dr. Jens Harbott Change-Id: Ic9f2cb0df6e52b23b17dd9494b6fceeef9626d8a --- hacking/checks/except_checks.py | 1 - hacking/checks/python23.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hacking/checks/except_checks.py b/hacking/checks/except_checks.py index a646de2..53ba79c 100644 --- a/hacking/checks/except_checks.py +++ b/hacking/checks/except_checks.py @@ -60,7 +60,6 @@ def hacking_except_format(logical_line, noqa): Okay: try:\n pass\nexcept Exception:\n pass H201: try:\n pass\nexcept:\n pass - H201: except: Okay: try:\n pass\nexcept: # noqa\n pass """ if noqa: diff --git a/hacking/checks/python23.py b/hacking/checks/python23.py index 80b911b..d44d257 100644 --- a/hacking/checks/python23.py +++ b/hacking/checks/python23.py @@ -152,7 +152,7 @@ def hacking_python3x_metaclass(logical_line, noqa): H236: class Foo(object):\n __metaclass__ = Meta H236: class Foo(object):\n foo=bar\n __metaclass__ = Meta H236: class Foo(object):\n '''docstr.'''\n __metaclass__ = Meta - H236: class Foo(object):\n __metaclass__ = \\\n Meta + H236: class Foo(object):\n __metaclass__ = \\n Meta Okay: class Foo(object):\n __metaclass__ = Meta # noqa """ if noqa: