From 2da38ce77570822e5a7e36854d452b7c5f5c308d Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Thu, 28 Aug 2014 00:01:55 -0700 Subject: [PATCH] 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 e4985767..6f1803b2 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://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()