mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 05:36:48 +03:00
Reinstate and simplify parallel auto-detection
This commit is contained in:
parent
74d2767c57
commit
810b61e78f
9
setup.py
9
setup.py
|
@ -326,6 +326,15 @@ class pil_build_ext(build_ext):
|
||||||
if self.debug:
|
if self.debug:
|
||||||
global DEBUG
|
global DEBUG
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
if not self.parallel:
|
||||||
|
# If --parallel (or -j) wasn't specified, we want to reproduce the same
|
||||||
|
# behavior as before, that is, auto-detect the number of jobs.
|
||||||
|
try:
|
||||||
|
self.parallel = int(
|
||||||
|
os.environ.get("MAX_CONCURRENCY", min(4, os.cpu_count()))
|
||||||
|
)
|
||||||
|
except TypeError:
|
||||||
|
self.parallel = None
|
||||||
for x in self.feature:
|
for x in self.feature:
|
||||||
if getattr(self, "disable_%s" % x):
|
if getattr(self, "disable_%s" % x):
|
||||||
setattr(self.feature, x, False)
|
setattr(self.feature, x, False)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user