Skip to content

Commit

Permalink
Fix bin/ansible to not make a double traceback on python3 (ansible#15972
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mscherer authored and abadger committed Jun 2, 2016
1 parent 805e0ec commit f002361
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/ansible
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ if __name__ == '__main__':
else:
raise AnsibleError("Unknown Ansible alias: %s" % me)
except ImportError as e:
if e.message.endswith(' %s' % sub):
# ImportError members have changed in py3
if 'msg' in dir(e):
msg = e.msg
else:
msg = e.message
if msg.endswith(' %s' % sub):
raise AnsibleError("Ansible sub-program not implemented: %s" % me)
else:
raise
Expand Down

0 comments on commit f002361

Please sign in to comment.