From 3d8019e3411e4bc411507a9c5765bcd39e36cc87 Mon Sep 17 00:00:00 2001 From: lanjelot Date: Fri, 20 Apr 2012 20:35:28 +1000 Subject: [PATCH] immediately quit if user hits ctrl-c twice --- patator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patator.py b/patator.py index c54e3f1..2f22749 100755 --- a/patator.py +++ b/patator.py @@ -1012,11 +1012,11 @@ Please read the README inside for more examples and usage information. if not tryok: self.stop_now = True - while True: - try: - if active_count() == 1: break + try: + while active_count() > 1: sleep(.1) - except KeyboardInterrupt: pass + except KeyboardInterrupt: + pass hits_count = sum(p.hits_count for p in self.thread_progress) done_count = sum(p.done_count for p in self.thread_progress)