From f2cd447a58fccef72f7e37f2ac37c218808ea234 Mon Sep 17 00:00:00 2001 From: kkka Date: Sun, 5 Oct 2014 02:42:27 +0900 Subject: [PATCH] Fix CLI to exit when server is shutdown --- onionshare/onionshare.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 5c0acde9..3fa13adb 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -261,8 +261,9 @@ def main(): # wait for app to close try: - while True: - time.sleep(0.5) + while t.is_alive(): + # t.join() can't catch KeyboradInterrupt in such as Ubuntu + t.join(0.5) except KeyboardInterrupt: web.stop(app.port) finally: