mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-26 09:21:23 -05:00
catch exceptions when cleaning up hidden services
This commit is contained in:
parent
2e39382126
commit
0350cb3cdc
@ -67,6 +67,8 @@ class OnionShare(object):
|
|||||||
self.cleanup_filenames = []
|
self.cleanup_filenames = []
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
|
# cleanup hidden service
|
||||||
|
try:
|
||||||
if self.controller:
|
if self.controller:
|
||||||
# Get fresh hidden services (maybe changed since last time)
|
# Get fresh hidden services (maybe changed since last time)
|
||||||
# and remove ourselves
|
# and remove ourselves
|
||||||
@ -80,6 +82,10 @@ class OnionShare(object):
|
|||||||
self.controller.set_options(hsdic2list(hsdic))
|
self.controller.set_options(hsdic2list(hsdic))
|
||||||
# Politely close the controller
|
# Politely close the controller
|
||||||
self.controller.close()
|
self.controller.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# cleanup files
|
||||||
for filename in self.cleanup_filenames:
|
for filename in self.cleanup_filenames:
|
||||||
if os.path.isfile(filename):
|
if os.path.isfile(filename):
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user