Codestyle fix.
This commit is contained in:
parent
69a35efb16
commit
ad8c4b93de
|
@ -41,7 +41,7 @@ def send_tor_signal(signal: Signal) -> bool:
|
||||||
try:
|
try:
|
||||||
# Try to authenticate with password.
|
# Try to authenticate with password.
|
||||||
with Controller.from_port(port=9051) as c:
|
with Controller.from_port(port=9051) as c:
|
||||||
with open("/opt/whoogle-search/misc/tor/control.conf", "r") as conf:
|
with open("./misc/tor/control.conf", "r") as conf:
|
||||||
for line in conf:
|
for line in conf:
|
||||||
pass
|
pass
|
||||||
secret = line
|
secret = line
|
||||||
|
@ -49,7 +49,8 @@ def send_tor_signal(signal: Signal) -> bool:
|
||||||
c.signal(signal)
|
c.signal(signal)
|
||||||
os.environ['TOR_AVAILABLE'] = '1'
|
os.environ['TOR_AVAILABLE'] = '1'
|
||||||
return True
|
return True
|
||||||
except (SocketError, ConnectionRefusedError, ConnectionError, FileNotFoundError):
|
except (SocketError, ConnectionRefusedError, ConnectionError,
|
||||||
|
FileNotFoundError):
|
||||||
# If password doesn't work try with cookie.
|
# If password doesn't work try with cookie.
|
||||||
try:
|
try:
|
||||||
with Controller.from_port(port=9051) as c:
|
with Controller.from_port(port=9051) as c:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user