[Numpy-svn] r6375 - branches/coremath/numpy/core

numpy-svn@scip... numpy-svn@scip...
Wed Feb 18 11:20:56 CST 2009


Author: cdavid
Date: 2009-02-18 11:20:50 -0600 (Wed, 18 Feb 2009)
New Revision: 6375

Modified:
   branches/coremath/numpy/core/setup.py
Log:
Check Python.h through compilation instead of looking for it on the FS + do not add python include, since it is already included by distutils.

Modified: branches/coremath/numpy/core/setup.py
===================================================================
--- branches/coremath/numpy/core/setup.py	2009-02-18 16:56:39 UTC (rev 6374)
+++ branches/coremath/numpy/core/setup.py	2009-02-18 17:20:50 UTC (rev 6375)
@@ -137,16 +137,12 @@
         if newer(__file__,target):
             config_cmd = config.get_config_cmd()
             log.info('Generating %s',target)
+
+            # Check we have the python header (-dev* packages on Linux)
+            config_cmd.check_header('Python.h')
+
             tc = generate_testcode(target)
-            from distutils import sysconfig
-            python_include = sysconfig.get_python_inc()
-            python_h = join(python_include, 'Python.h')
-            if not os.path.isfile(python_h):
-                raise SystemError,\
-                      "Non-existing %s. Perhaps you need to install"\
-                      " python-dev|python-devel." % (python_h)
-            result = config_cmd.try_run(tc,include_dirs=[python_include],
-                                        library_dirs = default_lib_dirs)
+            result = config_cmd.try_run(tc, library_dirs = default_lib_dirs)
             if not result:
                 raise SystemError,"Failed to test configuration. "\
                       "See previous error messages for more information."



More information about the Numpy-svn mailing list