Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Except ImportError when not packaged #2213

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sherlock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

"""

# This variable is only used to check for ImportErrors induced by users running as script rather than as module or package
import_error_test_var = None

__shortname__ = "Sherlock"
__longname__ = "Sherlock: Find Usernames Across Social Networks"
__version__ = "0.14.4"
10 changes: 9 additions & 1 deletion sherlock/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@
networks.
"""

import sys

try:
from sherlock.__init__ import import_error_test_var # noqa: F401
except ImportError:
print("Did you run Sherlock with `python3 sherlock/sherlock.py ...`?")
print("This is an outdated method. Please see https://sherlockproject.xyz/installation for up to date instructions.")
sys.exit(1)

import csv
import signal
import pandas as pd
import os
import re
import sys
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from time import monotonic

Expand Down
Loading