[Pkg-privacy-commits] [onionshare] 92/256: Properly handle KeyboardInterrupt exception in CLI in macOS
Ulrike Uhlig
ulrike at moszumanska.debian.org
Fri May 26 12:53:20 UTC 2017
This is an automated email from the git hooks/post-receive script.
ulrike pushed a commit to branch master
in repository onionshare.
commit a57703cb5a64002f00fce182a0dd150eabb62e22
Author: Micah Lee <micah at micahflee.com>
Date: Wed Feb 22 13:35:34 2017 -0800
Properly handle KeyboardInterrupt exception in CLI in macOS
---
onionshare/__init__.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/onionshare/__init__.py b/onionshare/__init__.py
index 8de8fa1..d05e08e 100644
--- a/onionshare/__init__.py
+++ b/onionshare/__init__.py
@@ -199,8 +199,10 @@ def main(cwd=None):
# wait for app to close
while t.is_alive():
- # t.join() can't catch KeyboardInterrupt in such as Ubuntu
- t.join(0.5)
+ t.join()
+ # allow KeyboardInterrupt exception to be handled with threads
+ # https://stackoverflow.com/questions/3788208/python-threading-ignores-keyboardinterrupt-exception
+ time.sleep(100)
except KeyboardInterrupt:
web.stop(app.port)
finally:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git
More information about the Pkg-privacy-commits
mailing list