From 747265f2aec975ef7afdba624472fad0e5f339c2 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Sun, 17 Jun 2018 11:14:43 -0400
Subject: [PATCH 11/24] Non-zero exit status on failure

https://bugs.gentoo.org/show_bug.cgi?id=281968
https://bugs.python.org/issue6731
---
 setup.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/setup.py b/setup.py
index fad7c39f25..469fa3c455 100644
--- a/setup.py
+++ b/setup.py
@@ -46,6 +46,8 @@ else:
     disable_ssl = 0
  
 
+exit_status = 0
+
 def add_dir_to_list(dirlist, dir):
     """Add the directory 'dir' to the list 'dirlist' (at the front) if
     1) 'dir' is not already in 'dirlist'
@@ -347,7 +349,10 @@ class PyBuildExt(build_ext):
                    " detect_modules() for the module's name.")
             print
 
+        global exit_status
+
         if self.failed:
+            exit_status = 1
             failed = self.failed[:]
             print
             print "Failed to build these modules:"
@@ -2353,6 +2358,7 @@ def main():
                      'Tools/scripts/2to3',
                      'Lib/smtpd.py']
         )
+    sys.exit(exit_status)
 
 # --install-platlib
 if __name__ == '__main__':
-- 
2.30.1

