diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2019-07-05 19:57:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-05 19:57:00 -0700 |
commit | d2e5b8474a7ad1704dc97b10e3af33b5654f3af4 (patch) | |
tree | f019fe13c75706aa4a95df11163a0b464d1d7f04 /lib | |
parent | f21073d231b1da00eedc99ec3c6702e01b6c9886 (diff) | |
download | spack-d2e5b8474a7ad1704dc97b10e3af33b5654f3af4.tar.gz spack-d2e5b8474a7ad1704dc97b10e3af33b5654f3af4.tar.bz2 spack-d2e5b8474a7ad1704dc97b10e3af33b5654f3af4.tar.xz spack-d2e5b8474a7ad1704dc97b10e3af33b5654f3af4.zip |
bugfix: always generate a stack trace when spack is run with --debug (#11940)
- We weren't previously printing stack traces on SystemExit or
KeyboardInterrupts.
- Either raise or print the stacktrace in these cases.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/main.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py index 9c84c2fb19..05c17067f9 100644 --- a/lib/spack/spack/main.py +++ b/lib/spack/spack/main.py @@ -16,6 +16,7 @@ import os import inspect import pstats import argparse +import traceback from six import StringIO import llnl.util.tty as tty @@ -705,10 +706,14 @@ def main(argv=None): tty.die(e) except KeyboardInterrupt: + if spack.config.get('config:debug'): + raise sys.stderr.write('\n') tty.die("Keyboard interrupt.") except SystemExit as e: + if spack.config.get('config:debug'): + traceback.print_exc() return e.code |