mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
On ast parser failure, try compiliation to get error
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user