Skip to content

Backport PR #17076: Fix SyntaxErrors when running setup in old Python #17187

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

Merged
Merged
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
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
if sys.version_info < min_version:
error = """
Beginning with Matplotlib 3.1, Python {0} or above is required.
You are using Python {1}.

This may be due to an out of date pip.

Make sure you have pip >= 9.0.1.
""".format('.'.join(str(n) for n in min_version)),
""".format('.'.join(str(n) for n in min_version),
'.'.join(str(n) for n in sys.version_info[:3]))
sys.exit(error)

from pathlib import Path
Expand Down Expand Up @@ -136,8 +138,9 @@ def _download_jquery_to(dest):
try:
buff = download_or_cache(url, sha)
except Exception:
raise IOError(f"Failed to download jquery-ui. Please download "
f"{url} and extract it to {dest}.")
raise IOError(
"Failed to download jquery-ui. Please download "
"{url} and extract it to {dest}.".format(url=url, dest=dest))
with ZipFile(buff) as zf:
zf.extractall(dest)

Expand Down Expand Up @@ -178,7 +181,7 @@ def run(self):
# If the user just queries for information, don't bother figuring out which
# packages to build or install.
if not (any('--' + opt in sys.argv
for opt in [*Distribution.display_option_names, 'help'])
for opt in Distribution.display_option_names + ['help'])
or 'clean' in sys.argv):
# Go through all of the packages and figure out which ones we are
# going to build/install.
Expand Down