catches exception when Tor is not open and trying to close server when it's not running

This commit is contained in:
Micah Lee 2014-08-28 00:01:55 -07:00
parent fcdcfd7c39
commit 2da38ce775

View File

@ -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()