Skip to content

Commit 485f08b

Browse files
committed
Move Python 2 check into setup.py.
This reduces the number of files we need to keep Python 2 compatible.
1 parent 3d929fc commit 485f08b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

setup.py

+11
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414

1515
import sys
1616

17+
if sys.version_info < (3, 5):
18+
error = """
19+
Matplotlib 3.0+ does not support Python 2.x, 3.0, 3.1, 3.2, 3.3, or 3.4.
20+
Beginning with Matplotlib 3.0, Python 3.5 and above is required.
21+
22+
This may be due to an out of date pip.
23+
24+
Make sure you have pip >= 9.0.1.
25+
"""
26+
sys.exit(error)
27+
1728
# distutils is breaking our sdists for files in symlinked dirs.
1829
# distutils will copy if os.link is not available, so this is a hack
1930
# to force copying

setupext.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# NOTE: This file must remain Python 2 compatible for the forseeable future,
2-
# to ensure that we error out properly for people with outdated setuptools
3-
# and/or pip.
41
from __future__ import print_function, absolute_import
52

63
from importlib import import_module

0 commit comments

Comments
 (0)