Cleanup
This commit is contained in:
parent
7b29a32e8d
commit
23ab71a992
|
@ -38,7 +38,6 @@ class TorError(Exception):
|
|||
|
||||
|
||||
def send_tor_signal(signal: Signal, confloc='./misc/tor/control.conf') -> bool:
|
||||
|
||||
try:
|
||||
# Try to authenticate with password.
|
||||
with open(confloc, "r") as conf:
|
||||
|
@ -47,9 +46,9 @@ def send_tor_signal(signal: Signal, confloc='./misc/tor/control.conf') -> bool:
|
|||
secret = line
|
||||
conf.close()
|
||||
with Controller.from_port(port=9051) as c:
|
||||
authenticate_password(c, password=secret)
|
||||
c.signal(signal)
|
||||
os.environ['TOR_AVAILABLE'] = '1'
|
||||
authenticate_password(c, password=secret)
|
||||
c.signal(signal)
|
||||
os.environ['TOR_AVAILABLE'] = '1'
|
||||
return True
|
||||
except (
|
||||
SocketError,
|
||||
|
|
Loading…
Reference in New Issue
Block a user