From a00298cbb77ad91560ea35fd0343470d4f4e5711 Mon Sep 17 00:00:00 2001 From: Daniel Damiani Date: Wed, 21 Sep 2022 10:42:17 -0700 Subject: [PATCH] Fix for pyflakes 2.5+ which removes some python 2 specific errors --- pyqode/python/backend/workers.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pyqode/python/backend/workers.py b/pyqode/python/backend/workers.py index bc6cc35..355baaa 100644 --- a/pyqode/python/backend/workers.py +++ b/pyqode/python/backend/workers.py @@ -214,12 +214,14 @@ def run_pep8(request_data): PYFLAKES_ERROR_MESSAGES = [ - messages.DoctestSyntaxError, - messages.ReturnWithArgsInsideGenerator, - messages.UndefinedExport, - messages.UndefinedName, - messages.UndefinedLocal + 'DoctestSyntaxError', + 'ReturnWithArgsInsideGenerator', + 'UndefinedExport', + 'UndefinedName', + 'UndefinedLocal' ] +PYFLAKES_ERROR_MESSAGES = [getattr(messages, x) for x in \ + PYFLAKES_ERROR_MESSAGES if hasattr(messages, x)] def run_pyflakes(request_data):