diff options
author | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2014-12-02 12:25:53 +0000 |
---|---|---|
committer | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2014-12-02 12:25:53 +0000 |
commit | 2a33c2e996d1dfc49def9ceca6ecab30c9f97ad3 (patch) | |
tree | e83dd29cc30782eee49bba1c45444777ebe4a53c | |
parent | 06d0e78abecfd25ec0b746227a65bea8dac46cf5 (diff) | |
download | import-2a33c2e996d1dfc49def9ceca6ecab30c9f97ad3.tar.gz |
Stuff
-rwxr-xr-x | exts/pip.find_deps | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/exts/pip.find_deps b/exts/pip.find_deps index 9019343..afed07b 100755 --- a/exts/pip.find_deps +++ b/exts/pip.find_deps @@ -293,23 +293,27 @@ def find_runtime_deps(source, name, version=None): import time -def handler(): +def handler(signal, frame): with open('/tmp/handler.txt', 'w'): f.write('hello there\n') + f.flush() + sys.exit(1) def main(): signal.signal(signal.SIGTERM, handler) + i = 0 try: - i = 0 while True: i += 1 logging.debug(i) - time.sleep(1) - except: + except BaseException as e: with open('/tmp/interrupt.txt', 'w') as f: - f.write('hello there\n') + f.write('hello there at %d\n' % i) + f.write('Got exception %s\n' % str(type(e))) + f.write('As str %s\n' % str(e)) + f.flush() raise if len(sys.argv) not in [3, 4]: |