Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 285 Bytes

README.md

File metadata and controls

23 lines (18 loc) · 285 Bytes

signal_decorator

Decorator example to catch signals in a python function

Eg:

@catch_sig
def test():
    import time
    print("Waiting")
    time.sleep(60)

if __name__ == "__main__":
    test()
$ ./signal_decorator.py 
Waiting...
^CGot killed