Use str(exc) instead of exc.message

...since on py3 tokenize.TokenError does not have a 'message' attribute.
See #203.
This commit is contained in:
Wouter Bolsterlee 2016-08-05 11:15:04 +02:00
parent 9a4abfbcb4
commit 45ae0b9eeb

View file

@ -247,7 +247,7 @@ class FileProcessor(object):
# course, I'm going to be unsurprised to be proven wrong at a later # course, I'm going to be unsurprised to be proven wrong at a later
# date. # date.
except tokenize.TokenError as exc: 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): def line_for(self, line_number):
"""Retrieve the physical line at the specified line number.""" """Retrieve the physical line at the specified line number."""