Skip to content

Commit 0ece8bf

Browse files
committed
Except ImportErrors induced by legacy run method
1 parent 501cb3d commit 0ece8bf

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

sherlock/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
66
"""
77

8+
# This variable is only used to check for ImportErrors induced by users running as script rather than as module or package
9+
importErrTestVar = None
10+
811
__shortname__ = "Sherlock"
912
__longname__ = "Sherlock: Find Usernames Across Social Networks"
1013
__version__ = "0.14.4"

sherlock/sherlock.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@
77
networks.
88
"""
99

10+
import sys
11+
12+
try:
13+
from sherlock.__init__ import importErrTestVar # noqa: F401
14+
except ImportError:
15+
print("Did you run Sherlock with `python3 sherlock/sherlock.py ...`?")
16+
print("This is an outdated method. Please see https://sherlockproject.xyz/installation for up to date instructions.")
17+
print("Most users can simply run `pipx install sherlock-project`, but other options are detailed on the website.")
18+
sys.exit(1)
19+
1020
import csv
1121
import signal
1222
import pandas as pd
1323
import os
1424
import re
15-
import sys
1625
from argparse import ArgumentParser, RawDescriptionHelpFormatter
1726
from time import monotonic
1827

0 commit comments

Comments
 (0)