On ast parser failure, try compiliation to get error
This commit is contained in:
parent
9b31175cf8
commit
28774875b4
1 changed files with 4 additions and 0 deletions
|
@ -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():
|
||||
|
|
Loading…
Reference in a new issue