aef3e059452c v0.3.1

Handle KeyboardInterrupt
[view raw] [browse files]
author Robin Baumgartner <robin@baumgartners.ch>
date Thu, 22 Nov 2012 14:12:59 +0100
parents c6ddd259d01c
children de2735512614
branches/tags v0.3.1
files ffind

Changes

--- a/ffind	Tue Nov 06 17:48:25 2012 -0500
+++ b/ffind	Thu Nov 22 14:12:59 2012 +0100
@@ -835,4 +835,9 @@
 
 
 if __name__ == '__main__':
+    import signal
+    def sigint_handler(signal, frame):
+        sys.stdout.write('\n')
+        sys.exit(130)
+    signal.signal(signal.SIGINT, sigint_handler)
     main()