summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-12 14:55:01 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-12 16:01:37 +0100
commit15bebc7a4ca6925c26e8685ddbf0c2d8ca788b93 (patch)
tree1f2f012ff6a2f298a3b299ae6fef8287f3da8802 /setuptools/command
parent9498fea0319d52b86415a3025e236f8c2b667863 (diff)
downloadpython-setuptools-git-15bebc7a4ca6925c26e8685ddbf0c2d8ca788b93.tar.gz
Prevent optional extensions from failing in build_ext
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)