From 28774875b4888fb605649915f26b55c6afbe3d82 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Mon, 29 Feb 2016 09:19:33 -0600 Subject: [PATCH] On ast parser failure, try compiliation to get error --- ansible_testing/modules.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible_testing/modules.py b/ansible_testing/modules.py index 721d4e1364..0572576714 100644 --- a/ansible_testing/modules.py +++ b/ansible_testing/modules.py @@ -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():