This commit is contained in:
MadcowOG 2022-05-04 01:07:37 -07:00
parent 7b29a32e8d
commit 23ab71a992

View File

@ -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,