Trac #247, better error reporting when Python.h not found.
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 19 Mar 2009 18:58:58 +0000 (11:58 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 19 Mar 2009 18:58:58 +0000 (11:58 -0700)
Cython/Compiler/ModuleNode.py

index 937240d0360d63ee5bcb5fc9aeadf83576ff0cfc..e3cb4b6f652ebbd29344afcc5025ab24adf85ada 100644 (file)
@@ -406,6 +406,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
         code.putln('#define PY_SSIZE_T_CLEAN')
         for filename in env.python_include_files:
             code.putln('#include "%s"' % filename)
+        code.putln("#ifndef Py_PYTHON_H")
+        code.putln("    #error Python headers needed to compile C extensions, please install development version of Python.")
+        code.putln("#endif")
         code.putln("#ifndef PY_LONG_LONG")
         code.putln("  #define PY_LONG_LONG LONG_LONG")
         code.putln("#endif")