On ast parser failure, try compiliation to get error

This commit is contained in:
Matt Martz 2016-02-29 09:19:33 -06:00 committed by John Barker
parent 9b31175cf8
commit 28774875b4

View file

@ -498,6 +498,10 @@ class ModuleValidator(Validator):
if self._python_module() and self.ast is None:
self.errors.append('Python SyntaxError while parsing module')
try:
compile(self.text, self.path, 'exec')
except Exception as e:
self.traces.append(e)
return
if self._python_module():