Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2c62f06

Browse filesBrowse files
authored
Merge pull request #17076 from QuLogic/old-setup
Fix SyntaxErrors when running setup in old Python
2 parents 0917934 + dabc706 commit 2c62f06
Copy full SHA for 2c62f06

File tree

Expand file treeCollapse file tree

1 file changed

+10
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-6
lines changed

‎setup.py

Copy file name to clipboardExpand all lines: setup.py
+10-6Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
if sys.version_info < min_version:
1414
error = """
1515
Beginning with Matplotlib 3.1, Python {0} or above is required.
16+
You are using Python {1}.
1617
1718
This may be due to an out of date pip.
1819
1920
Make sure you have pip >= 9.0.1.
20-
""".format('.'.join(str(n) for n in min_version)),
21+
""".format('.'.join(str(n) for n in min_version),
22+
'.'.join(str(n) for n in sys.version_info[:3]))
2123
sys.exit(error)
2224

2325
from pathlib import Path
@@ -112,8 +114,9 @@ def _download_jquery_to(dest):
112114
try:
113115
buff = download_or_cache(url, sha)
114116
except Exception:
115-
raise IOError(f"Failed to download jquery-ui. Please download "
116-
f"{url} and extract it to {dest}.")
117+
raise IOError(
118+
"Failed to download jquery-ui. Please download "
119+
"{url} and extract it to {dest}.".format(url=url, dest=dest))
117120
with ZipFile(buff) as zf:
118121
zf.extractall(dest)
119122

@@ -154,7 +157,7 @@ def run(self):
154157
# If the user just queries for information, don't bother figuring out which
155158
# packages to build or install.
156159
if not (any('--' + opt in sys.argv
157-
for opt in [*Distribution.display_option_names, 'help'])
160+
for opt in Distribution.display_option_names + ['help'])
158161
or 'clean' in sys.argv):
159162
# Go through all of the packages and figure out which ones we are
160163
# going to build/install.
@@ -169,10 +172,11 @@ def run(self):
169172
try:
170173
message = package.check()
171174
except setupext.Skipped as e:
172-
print_status(package.name, f"no [{e}]")
175+
print_status(package.name, "no [{e}]".format(e=e))
173176
continue
174177
if message is not None:
175-
print_status(package.name, f"yes [{message}]")
178+
print_status(package.name,
179+
"yes [{message}]".format(message=message))
176180
good_packages.append(package)
177181

178182
print_raw()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.