summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-12 19:40:31 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-12 19:40:31 +0100
commite4dd4bdd923cfc2f69dd4cfbb119644bb46e5e9d (patch)
tree6c73d1ff87b8f0ef3b1dbf1a0edded8092ed9a95 /setuptools/command
parent4a3519dcf57092736e16240881e0ea3e2d2425d0 (diff)
parentd81613ac88ea1cba36a8d31eb747a8fe0e9c0fc8 (diff)
downloadpython-setuptools-git-e4dd4bdd923cfc2f69dd4cfbb119644bb46e5e9d.tar.gz
Prevent optional extensions from crashing editable builds (#3515)
- Don't try to copy the files of an optional extension if its build has failed.
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/build_ext.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py
index 7ad5a87a..cbfe3ec1 100644
--- a/setuptools/command/build_ext.py
+++ b/setuptools/command/build_ext.py
@@ -104,7 +104,8 @@ class build_ext(_build_ext):
# Always copy, even if source is older than destination, to ensure
# that the right extensions for the current Python/platform are
# used.
- self.copy_file(regular_file, inplace_file, level=self.verbose)
+ if os.path.exists(regular_file) or not ext.optional:
+ self.copy_file(regular_file, inplace_file, level=self.verbose)
if ext._needs_stub:
inplace_stub = self._get_equivalent_stub(ext, inplace_file)