Skip to content

Commit

Permalink
gsutil is supported till python 3.11.9
Browse files Browse the repository at this point in the history
message edit

combined check

Gsutil Support Check for python versions

detailed message

removed f string

Gsutil Support Check for Python Versions 3.5 to 3.11
  • Loading branch information
sameer-google authored and sushantkhanna committed Sep 25, 2024
1 parent 5edbecb commit c8e2709
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gsutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@
# 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):
sys.exit('gsutil requires python 2.7 or 3.5+.')
if (ver.major == 2 and ver.minor < 7) or (ver.major == 3 and (ver.minor < 5 or ver.minor > 11)):
sys.exit(
"Error: gsutil requires Python version 2.7 or 3.5-3.11, 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"
"\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)
)

# setup a string to load the correct httplib2
if sys.version_info.major == 2:
Expand Down

0 comments on commit c8e2709

Please sign in to comment.