Skip to content

Commit f2090bd

Browse files
authored
Merge pull request #2033 from joaomfbh/tor_exception_handling
Add exception handling for Tor option
2 parents 0d953ff + dc5d6d6 commit f2090bd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sherlock/sherlock.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@ def sherlock(
200200
# Create session based on request methodology
201201
if tor or unique_tor:
202202
# Requests using Tor obfuscation
203-
underlying_request = TorRequest()
203+
try:
204+
underlying_request = TorRequest()
205+
except OSError:
206+
print("Tor not found in system path. Unable to continue.\n")
207+
sys.exit(query_notify.finish())
208+
204209
underlying_session = underlying_request.session
205210
else:
206211
# Normal requests

0 commit comments

Comments
 (0)