Remebered why I put the open inside the try block
This commit is contained in:
parent
7f56e16329
commit
aff06a671e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user