capture keyboardinterrupt in python without try-except,time.sleep(1)