Patchwork setup: make error message for missing Python headers more helpful

login
register
mail settings
Submitter Mads Kiilerich
Date April 11, 2013, 8:37 p.m.
Message ID <027e7edd2707aba417c2.1365712646@mk-desktop>
Download mbox | patch
Permalink /patch/1282/
State Accepted, archived
Delegated to: Augie Fackler
Headers show

Comments

Mads Kiilerich - April 11, 2013, 8:37 p.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1360539792 -3600
#      Mon Feb 11 00:43:12 2013 +0100
# Node ID 027e7edd2707aba417c22fc9bf813d73ef54f6ea
# Parent  2019611e6858ce9b297da4fe7631bc7b7b00c777
setup: make error message for missing Python headers more helpful

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -297,9 +297,10 @@ 
                     self.py_modules.append("mercurial.pure.%s" % ext.name[10:])
             self.distribution.ext_modules = []
         else:
-            if not os.path.exists(os.path.join(get_python_inc(), 'Python.h')):
+            h = os.path.join(get_python_inc(), 'Python.h')
+            if not os.path.exists(h):
                 raise SystemExit('Python headers are required to build '
-                                 'Mercurial')
+                                 'Mercurial but wasn\'t found in %s' % h)
 
     def find_modules(self):
         modules = build_py.find_modules(self)