aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2018-01-05 13:32:45 -0500
committerMichał Górny <mgorny@gentoo.org>2020-04-22 14:09:51 +0200
commit4a63fb604c2257e7b84e73e8b524b08144c8160f (patch)
treecad6c2f85074f7230cd62067dbc32a3f62a286c9
parentOverride libdir (diff)
downloadcpython-4a63fb604c2257e7b84e73e8b524b08144c8160f.tar.gz
cpython-4a63fb604c2257e7b84e73e8b524b08144c8160f.tar.bz2
cpython-4a63fb604c2257e7b84e73e8b524b08144c8160f.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.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index d7a0a7be391..24d0aa6532d 100644
--- a/setup.py
+++ b/setup.py
@@ -60,6 +60,8 @@ if pds_env in os.environ:
else:
disable_ssl = 0
+exit_status = 0
+
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (after any relative
directories) if:
@@ -402,7 +404,10 @@ class PyBuildExt(build_ext):
print_three_column([ext.name for ext in mods_disabled])
print()
+ global exit_status
+
if self.failed:
+ exit_status = 1
failed = self.failed[:]
print()
print("Failed to build these modules:")
@@ -410,6 +415,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"
@@ -2408,6 +2414,7 @@ def main():
scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
"Tools/scripts/2to3", "Tools/scripts/pyvenv"]
)
+ sys.exit(exit_status)
# --install-platlib
if __name__ == '__main__':