summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2021-07-11 13:49:35 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2021-07-13 01:17:51 -0700
commit60765d38d06c5ceffa3e65f8fffdc4c7233fddc9 (patch)
treec74dc6289265b0b5a6a3f38f198de82aedb031f3 /lib
parent667ab501996058b1f89f1763d1791befa455b1f8 (diff)
downloadspack-60765d38d06c5ceffa3e65f8fffdc4c7233fddc9.tar.gz
spack-60765d38d06c5ceffa3e65f8fffdc4c7233fddc9.tar.bz2
spack-60765d38d06c5ceffa3e65f8fffdc4c7233fddc9.tar.xz
spack-60765d38d06c5ceffa3e65f8fffdc4c7233fddc9.zip
Fix KeyboardInterrupt signal for Python 2
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/main.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py
index ea65ab99df..fcf6369df7 100644
--- a/lib/spack/spack/main.py
+++ b/lib/spack/spack/main.py
@@ -782,7 +782,10 @@ def main(argv=None):
raise
sys.stderr.write('\n')
tty.error("Keyboard interrupt.")
- return signal.SIGINT.value
+ if sys.version_info >= (3, 5):
+ return signal.SIGINT.value
+ else:
+ return signal.SIGINT
except SystemExit as e:
if spack.config.get('config:debug'):