mirror of
https://github.com/onionshare/onionshare.git
synced 2025-04-25 17:59:17 -04:00
Put wait for circuits to close login in a try/except, so Ctrl-C does not cause a crash
This commit is contained in:
parent
3871fcf5eb
commit
752afcaa3a
@ -749,6 +749,9 @@ class Onion(object):
|
|||||||
if stop_tor:
|
if stop_tor:
|
||||||
# Stop tor process
|
# Stop tor process
|
||||||
if self.tor_proc:
|
if self.tor_proc:
|
||||||
|
# Wait for Tor rendezvous circuits to close
|
||||||
|
# Catch exceptions to prevent crash on Ctrl-C
|
||||||
|
try:
|
||||||
rendevouz_circuit_ids = []
|
rendevouz_circuit_ids = []
|
||||||
for c in self.c.get_circuits():
|
for c in self.c.get_circuits():
|
||||||
if c.purpose == "HS_SERVICE_REND":
|
if c.purpose == "HS_SERVICE_REND":
|
||||||
@ -774,6 +777,8 @@ class Onion(object):
|
|||||||
end="",
|
end="",
|
||||||
)
|
)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
self.tor_proc.terminate()
|
self.tor_proc.terminate()
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user