1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Allow PDB to enter post mortem. fixes (#31086)

This commit is contained in:
Julien Palard 2017-11-21 20:11:53 +01:00 committed by Toshio Kuratomi
parent ff938bfdd5
commit 53d9f9ffae

View file

@ -129,6 +129,10 @@ if __name__ == '__main__':
display.error("User interrupted execution") display.error("User interrupted execution")
exit_code = 99 exit_code = 99
except Exception as e: except Exception as e:
if C.DEFAULT_DEBUG:
# Show raw stacktraces in debug mode, It also allow pdb to
# enter post mortem mode.
raise
have_cli_options = cli is not None and cli.options is not None have_cli_options = cli is not None and cli.options is not None
display.error("Unexpected Exception, this is probably a bug: %s" % to_text(e), wrap_text=False) display.error("Unexpected Exception, this is probably a bug: %s" % to_text(e), wrap_text=False)
if not have_cli_options or have_cli_options and cli.options.verbosity > 2: if not have_cli_options or have_cli_options and cli.options.verbosity > 2: