[stable-2.13] Fix sanity test crash. (#77475)

(cherry picked from commit 6216c9fc93)

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/77488/head
Matt Clay 4 years ago committed by GitHub
parent 6b6b324618
commit 3b20b02272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- "ansible-test compile sanity test - do not crash if a column could not be determined for an error (https://github.com/ansible/ansible/pull/77465)."

@ -24,6 +24,10 @@ def main():
else:
continue
# In some situations offset can be None. This can happen for syntax errors on Python 2.6
# (__future__ import following after a regular import).
offset = offset or 0
result = "%s:%d:%d: %s: %s" % (path, lineno, offset, extype.__name__, safe_message(message))
if sys.version_info <= (3,):

Loading…
Cancel
Save