diff --git a/.travis.yml b/.travis.yml index 6f14035e8..0b6263480 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,6 @@ language: python notifications: irc: "chat.freenode.net#pil" -env: MAX_CONCURRENCY=4 - # Run slow PyPy* first, to give them a headstart and reduce waiting time. # Run latest 3.x and 2.x next, to get quick compatibility results. # Then run the remainder. diff --git a/docs/installation.rst b/docs/installation.rst index aba6d14a6..7e29e70e0 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -97,11 +97,9 @@ Build Options ------------- * Environment Variable: ``MAX_CONCURRENCY=n``. By default, Pillow will - use multiprocessing to build the extension in parallel. This may not - be ideal for machines that report a large number of cores compared - to the actual processor power. Set ``MAX_CONCURRENCY`` to 1 to disable - parallel building, or to a larger number to limit to that number of - parallel tasks. + use multiprocessing to build the extension on all available CPU, + but not more than 4. Setting ``MAX_CONCURRENCY`` to 1 will disable + parallel building. * Build flags: ``--disable-zlib``, ``--disable-jpeg``, ``--disable-tiff``, ``--disable-freetype``, ``--disable-tcl``, diff --git a/mp_compile.py b/mp_compile.py index c8a437400..955cd9c1b 100644 --- a/mp_compile.py +++ b/mp_compile.py @@ -6,8 +6,8 @@ from distutils.ccompiler import CCompiler import os, sys try: - MAX_PROCS = int(os.environ.get('MAX_CONCURRENCY', cpu_count())) -except: + MAX_PROCS = int(os.environ.get('MAX_CONCURRENCY', min(4, cpu_count()))) +except NotImplementedError: MAX_PROCS = None