Fail the CI if an optional module fails to compile (GH-27466)

This commit is contained in:
Pablo Galindo Salgado 2021-07-30 15:21:09 +01:00 committed by GitHub
parent f4367ba3c5
commit 7cad0bee80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -571,6 +571,9 @@ class PyBuildExt(build_ext):
print("Custom linker flags may require --with-openssl-rpath=auto")
print()
if os.environ.get("PYTHONSTRICTEXTENSIONBUILD") and (self.failed or self.failed_on_import):
raise RuntimeError("Failed to build some stdlib modules")
def build_extension(self, ext):
if ext.name == '_ctypes':