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:
|
def send_tor_signal(signal: Signal, confloc='./misc/tor/control.conf') -> bool:
|
||||||
with open(confloc, "r") as conf:
|
|
||||||
for line in conf:
|
|
||||||
pass
|
|
||||||
secret = line
|
|
||||||
conf.close()
|
|
||||||
try:
|
try:
|
||||||
# Try to authenticate with password.
|
# Try to authenticate with password.
|
||||||
|
with open(confloc, "r") as conf:
|
||||||
|
for line in conf:
|
||||||
|
pass
|
||||||
|
secret = line
|
||||||
|
conf.close()
|
||||||
with Controller.from_port(port=9051) as c:
|
with Controller.from_port(port=9051) as c:
|
||||||
authenticate_password(c, password=secret)
|
authenticate_password(c, password=secret)
|
||||||
c.signal(signal)
|
c.signal(signal)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user