diff python/count.py @ 800:8275fa887f2b

cleanup + renaming
author Jeff Hammel <k0scist@gmail.com>
date Fri, 28 Oct 2016 16:11:24 -0700
parents 25622fb5906d
children
line wrap: on
line diff
--- a/python/count.py	Fri Oct 28 16:06:11 2016 -0700
+++ b/python/count.py	Fri Oct 28 16:11:24 2016 -0700
@@ -58,7 +58,12 @@
     options = parser.parse_args(args)
 
     # read a thing
-    items = options.input.read().strip().split()
+    try:
+        items = options.input.read().strip().split()
+    except KeyboardInterrupt:
+        # probably trying to read stdin interactively
+        # revert! revert! revert!
+        return
 
     if options.duplicates:
         print ('\n'.join(sorted(duplicates(*items))))