Py2.3 and eval.h: include C header in proto section of pyexec_utility_code
authorLisandro Dalcin <dalcinl@gmail.com>
Mon, 14 Sep 2009 16:09:56 +0000 (13:09 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Mon, 14 Sep 2009 16:09:56 +0000 (13:09 -0300)
Cython/Compiler/Builtin.py

index a4bf037ab5acc64a877812d0c6c5724c19661545..e186e66c583c2ae4b4e319b24d9cb408f19b5ba2 100644 (file)
@@ -163,21 +163,21 @@ bad:
 
 pyexec_utility_code = UtilityCode(
 proto = """
-static PyObject* __Pyx_PyRun(PyObject*, PyObject*, PyObject*);
-""",
-impl = '''
 #if PY_VERSION_HEX < 0x02040000
 #ifndef Py_EVAL_H
 #include "eval.h"
 #endif
 #endif
+static PyObject* __Pyx_PyRun(PyObject*, PyObject*, PyObject*);
+""",
+impl = """
 static PyObject* __Pyx_PyRun(PyObject* o, PyObject* globals, PyObject* locals) {
     PyObject* result;
     PyObject* s = 0;
     char *code = 0;
 
     if (!globals || globals == Py_None) {
-        globals = PyModule_GetDict(%s);''' % Naming.module_cname + '''
+        globals = PyModule_GetDict(%s);""" % Naming.module_cname + """
         if (!globals)
             goto bad;
     } else if (!PyDict_Check(globals)) {
@@ -236,7 +236,7 @@ bad:
     Py_XDECREF(s);
     return 0;
 }
-''')
+""")
 
 intern_utility_code = UtilityCode(
 proto = """