Remebered why I put the open inside the try block

This commit is contained in:
MadcowOG 2022-05-04 00:59:21 -07:00
parent 7f56e16329
commit aff06a671e

View File

@ -38,13 +38,14 @@ 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:
for line in conf:
pass
secret = line
conf.close()
try:
# Try to authenticate with password.
with Controller.from_port(port=9051) as c:
authenticate_password(c, password=secret)
c.signal(signal)