[Pkg-anonymity-tools] [onionshare] 43/140: catches exception when Tor is not open and trying to close server when it's not running

Ulrike Uhlig u-guest at moszumanska.debian.org
Mon Sep 29 20:33:46 UTC 2014


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch master
in repository onionshare.

commit 2da38ce77570822e5a7e36854d452b7c5f5c308d
Author: Micah Lee <micah at micahflee.com>
Date:   Thu Aug 28 00:01:55 2014 -0700

    catches exception when Tor is not open and trying to close server when it's not running
---
 onionshare_gui/onionshare_gui.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py
index e498576..6f1803b 100644
--- a/onionshare_gui/onionshare_gui.py
+++ b/onionshare_gui/onionshare_gui.py
@@ -93,7 +93,10 @@ class OnionShareGui(QtGui.QWidget):
 
     def stop_server(self):
         # to stop flask, load http://127.0.0.1:<port>/<shutdown_slug>/shutdown
-        urllib2.urlopen('http://127.0.0.1:{0}/{1}/shutdown'.format(self.app.port, web.shutdown_slug)).read()
+        try:
+            urllib2.urlopen('http://127.0.0.1:{0}/{1}/shutdown'.format(self.app.port, web.shutdown_slug)).read()
+        except:
+            pass
         self.app.cleanup()
 
         self.server_status.stop_server_finished()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/onionshare.git



More information about the Pkg-anonymity-tools mailing list