Skip to content

Commit c889643

Browse files
committed
use a different temp build dir for each module
1 parent 3b33a2c commit c889643

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,17 @@ def build_extensions(self) -> None:
938938

939939
self.summary_report(feature)
940940

941+
def build_extension(self, ext):
942+
# Append the extension name (not including "PIL.") to the temp build directory
943+
# so that each module builds to its own directory. We need to make a (shallow)
944+
# copy of 'self' here so that we don't overwrite this value when running in
945+
# parallel.
946+
import copy
947+
948+
self_copy = copy.copy(self)
949+
self_copy.build_temp = os.path.join(self.build_temp, ext.name[4:])
950+
build_ext.build_extension(self_copy, ext)
951+
941952
def summary_report(self, feature: ext_feature) -> None:
942953
print("-" * 68)
943954
print("PIL SETUP SUMMARY")

0 commit comments

Comments
 (0)