diff options
author | Bradley Sepos <[email protected]> | 2016-05-24 18:44:12 -0400 |
---|---|---|
committer | Bradley Sepos <[email protected]> | 2016-05-25 15:45:05 -0400 |
commit | 8507acecae257bf42019a0fa2662d71277bcc6ce (patch) | |
tree | b17096260e9a2ea9e96a9d8bd13ccdf246a0795a /make/df-fetch.py | |
parent | 3bf86382ab351ac0db02dcef41ed27502ff4fb41 (diff) |
build: Add basic termination signal handling to df-*.py.
Diffstat (limited to 'make/df-fetch.py')
-rw-r--r-- | make/df-fetch.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/make/df-fetch.py b/make/df-fetch.py index 882e105c7..93b639cd0 100644 --- a/make/df-fetch.py +++ b/make/df-fetch.py @@ -13,6 +13,7 @@ import hashlib import random import re import os +import signal import sys import time import urllib2 @@ -23,6 +24,15 @@ import hb_distfile ############################################################################### +def signal_handler(signal, frame): + sys.stderr.write('^C') + sys.exit(1) + +signal.signal(signal.SIGINT, signal_handler) +signal.signal(signal.SIGTERM, signal_handler) + +############################################################################### + ## simple structure object class Struct(object): pass |