aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2018-01-05 13:32:45 -0500
committerMichał Górny <mgorny@gentoo.org>2021-09-29 19:13:29 +0200
commit9792940ce537da04af23bcea8b66b7886c68422e (patch)
treec15bff75d9a43db86a54a64ff69c7c3888e606fd
parentOverride libdir (diff)
downloadcpython-9792940ce537da04af23bcea8b66b7886c68422e.tar.gz
cpython-9792940ce537da04af23bcea8b66b7886c68422e.tar.bz2
cpython-9792940ce537da04af23bcea8b66b7886c68422e.zip
setup.py: exit with non-zero status on failure
https://bugs.gentoo.org/show_bug.cgi?id=281968 https://bugs.python.org/issue6731
-rw-r--r--setup.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index fe7a703381a..f65fd90fed0 100644
--- a/setup.py
+++ b/setup.py
@@ -126,6 +126,7 @@ Programming Language :: Python
Topic :: Software Development
"""
+exit_status = 0
def run_command(cmd):
status = os.system(cmd)
@@ -556,8 +557,10 @@ class PyBuildExt(build_ext):
print("been built, they are *disabled* by configure:")
print_three_column(self.disabled_configure)
print()
+ global exit_status
if self.failed:
+ exit_status = 1
failed = self.failed[:]
print()
print("Failed to build these modules:")
@@ -565,6 +568,7 @@ class PyBuildExt(build_ext):
print()
if self.failed_on_import:
+ exit_status = 1
failed = self.failed_on_import[:]
print()
print("Following modules built successfully"
@@ -2746,6 +2750,7 @@ def main():
scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
"Tools/scripts/2to3"]
)
+ sys.exit(exit_status)
# --install-platlib
if __name__ == '__main__':