From 04ae18cc8a3ec79e25644074923bbcf780f47272 Mon Sep 17 00:00:00 2001 From: Nache Date: Fri, 18 Oct 2024 12:28:04 +0200 Subject: [PATCH 1/2] upgrade python version err msg --- gsutil.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gsutil.py b/gsutil.py index 30b8a5ac8..05430881b 100755 --- a/gsutil.py +++ b/gsutil.py @@ -27,12 +27,12 @@ # TODO: gsutil-beta: Distribute a pylint rc file. ver = sys.version_info -if (ver.major == 2 and ver.minor < 7) or (ver.major == 3 and (ver.minor < 5 or ver.minor > 11)): +if (vermajor == 3 and verminor < 5) or (vermajor == 4): sys.exit( - "Error: gsutil requires Python version 2.7 or 3.5-3.11, but a different version is installed.\n" + "Error: gsutil requires Python version 3.5+ and <4, but a different version is installed.\n" "You are currently running Python {}.{}\n" "Follow the steps below to resolve this issue:\n" - "\t1. Switch to Python 3.5-3.11 using your Python version manager or install an appropriate version.\n" + "\t1. Switch to Python 3.5+ and <4 using your Python version manager or install an appropriate version.\n" "\t2. If you are unsure how to manage Python versions, visit [https://cloud.google.com/storage/docs/gsutil_install#specifications] for detailed instructions.".format(ver.major, ver.minor) ) From faaf00977b4205ec9261b76ffc5c356f9c0d3e6c Mon Sep 17 00:00:00 2001 From: "J.A. Nache" Date: Fri, 18 Oct 2024 21:50:51 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Elijah Lynn --- gsutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsutil.py b/gsutil.py index 05430881b..b69d96f52 100755 --- a/gsutil.py +++ b/gsutil.py @@ -27,7 +27,7 @@ # TODO: gsutil-beta: Distribute a pylint rc file. ver = sys.version_info -if (vermajor == 3 and verminor < 5) or (vermajor == 4): +if (ver.major == 3 and ver.minor < 5) or (ver.major == 4): sys.exit( "Error: gsutil requires Python version 3.5+ and <4, but a different version is installed.\n" "You are currently running Python {}.{}\n"