From cdda459ac56df9340c7ca760c01d20056e2c16ee Mon Sep 17 00:00:00 2001 From: Jacky Lee Date: Mon, 26 Apr 2021 21:26:21 -0700 Subject: [PATCH 1/2] Improve version checking code --- sherlock/__main__.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sherlock/__main__.py b/sherlock/__main__.py index 52645a49..2f600b73 100644 --- a/sherlock/__main__.py +++ b/sherlock/__main__.py @@ -11,17 +11,10 @@ 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] + """Check if the user is using the correct version of Python""" + python_version = sys.version.split()[0] - if major != 3 or major == 3 and minor < 6: - python_version = str(major) + "." + str(minor) + "." + str(sys.version_info[2]) + if sys.version_info < (3, 6): print("Sherlock requires Python 3.6+\nYou are using Python %s, which is not supported by Sherlock" % (python_version)) sys.exit(1) From b9d13c6a96ea551064d12e6dde26ed0b6ba049c3 Mon Sep 17 00:00:00 2001 From: Jacky Lee Date: Mon, 26 Apr 2021 22:25:04 -0700 Subject: [PATCH 2/2] Use # for comment instead of """ --- sherlock/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sherlock/__main__.py b/sherlock/__main__.py index 2f600b73..28d0a160 100644 --- a/sherlock/__main__.py +++ b/sherlock/__main__.py @@ -11,7 +11,7 @@ import sys if __name__ == "__main__": - """Check if the user is using the correct version of Python""" + # Check if the user is using the correct version of Python python_version = sys.version.split()[0] if sys.version_info < (3, 6):