diff options
author | Mike Gilbert <floppym@gentoo.org> | 2018-01-05 13:32:45 -0500 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-04-22 14:09:51 +0200 |
commit | 4a63fb604c2257e7b84e73e8b524b08144c8160f (patch) | |
tree | cad6c2f85074f7230cd62067dbc32a3f62a286c9 | |
parent | Override libdir (diff) | |
download | cpython-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.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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__': |