From 45ae0b9eebc1e47df1a049e75d64e25118299d65 Mon Sep 17 00:00:00 2001 From: Wouter Bolsterlee Date: Fri, 5 Aug 2016 11:15:04 +0200 Subject: [PATCH] Use str(exc) instead of exc.message ...since on py3 tokenize.TokenError does not have a 'message' attribute. See #203. --- src/flake8/processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flake8/processor.py b/src/flake8/processor.py index 1d0e3a4..2a4014e 100644 --- a/src/flake8/processor.py +++ b/src/flake8/processor.py @@ -247,7 +247,7 @@ class FileProcessor(object): # course, I'm going to be unsurprised to be proven wrong at a later # date. except tokenize.TokenError as exc: - raise exceptions.InvalidSyntax(exc.message, exception=exc) + raise exceptions.InvalidSyntax(str(exc), exception=exc) def line_for(self, line_number): """Retrieve the physical line at the specified line number."""