Update python script to catch all exceptions except KeyboardInterrupt