Skip to content

Commit ccaac6e

Browse files
committed
Merge pull request #2446 from mdboom/old-distribute
Don't set use_2to3 unless we have to.
2 parents 513637b + 9885f41 commit ccaac6e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

setup.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@
206206
mod.extra_compile_args.append('-DVERBOSE')
207207

208208

209+
extra_args = {}
210+
if sys.version_info[0] >= 3:
211+
# Automatically 2to3 source on Python 3.x. This isn't set on
212+
# Python 2 because it's not needed, and some really old
213+
# versions of distribute don't support it.
214+
extra_args['use_2to3'] = True
215+
216+
209217
# Finally, pass this all along to distutils to do the heavy lifting.
210218
distrib = setup(name="matplotlib",
211219
version=__version__,
@@ -234,11 +242,10 @@
234242
# List third-party Python packages that we require
235243
install_requires=install_requires,
236244

237-
# Automatically 2to3 source on Python 3.x
238-
use_2to3=True,
239-
240245
# matplotlib has C/C++ extensions, so it's not zip safe.
241246
# Telling setuptools this prevents it from doing an automatic
242247
# check for zip safety.
243248
zip_safe=False,
249+
250+
**extra_args
244251
)

0 commit comments

Comments
 (0)