mirror of
https://github.com/sherlock-project/sherlock
synced 2025-02-17 04:58:28 +00:00
Merge pull request #678 from sherlock-project/check-version
Check Python version before executing the main function of Sherlock
This commit is contained in:
commit
cdba7227c8
1 changed files with 20 additions and 1 deletions
|
@ -7,8 +7,27 @@ This module contains the main logic to search for usernames at social
|
|||
networks.
|
||||
"""
|
||||
|
||||
import sherlock
|
||||
import sys
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Checking if the user is using the correct version of Python
|
||||
# Reference:
|
||||
# If Python version is 3.6.5
|
||||
# major --^
|
||||
# minor ----^
|
||||
# micro ------^
|
||||
major = sys.version_info[0]
|
||||
minor = sys.version_info[1]
|
||||
|
||||
python_version = str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])
|
||||
|
||||
if major != 3:
|
||||
print("Sherlock requires Python 3.6+\nYou are using Python %s, which is not supported by Sherlock" % (python_version))
|
||||
sys.exit(1)
|
||||
if minor < 6:
|
||||
print("Sherlock requires Python 3.6+\nYou are using Python %s, which is not supported by Sherlock" % (python_version))
|
||||
sys.exit(1)
|
||||
|
||||
import sherlock
|
||||
sherlock.main()
|
||||
|
|
Loading…
Add table
Reference in a new issue