Commit c31c7e90 authored by Stefan Behnel's avatar Stefan Behnel

Fix error reporting on very early errors when the Cython runtime configuration...

Fix error reporting on very early errors when the Cython runtime configuration module is not set up yet.
See #2199.
parent 8e618b58
...@@ -707,7 +707,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -707,7 +707,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln('static PyObject *%s = NULL;' % env.module_cname) code.putln('static PyObject *%s = NULL;' % env.module_cname)
code.putln('static PyObject *%s;' % env.module_dict_cname) code.putln('static PyObject *%s;' % env.module_dict_cname)
code.putln('static PyObject *%s;' % Naming.builtins_cname) code.putln('static PyObject *%s;' % Naming.builtins_cname)
code.putln('static PyObject *%s;' % Naming.cython_runtime_cname) code.putln('static PyObject *%s = NULL;' % Naming.cython_runtime_cname)
code.putln('static PyObject *%s;' % Naming.empty_tuple) code.putln('static PyObject *%s;' % Naming.empty_tuple)
code.putln('static PyObject *%s;' % Naming.empty_bytes) code.putln('static PyObject *%s;' % Naming.empty_bytes)
code.putln('static PyObject *%s;' % Naming.empty_unicode) code.putln('static PyObject *%s;' % Naming.empty_unicode)
......
...@@ -617,6 +617,12 @@ static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_li ...@@ -617,6 +617,12 @@ static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_li
#if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_COMPILING_IN_CPYTHON
PyObject **cython_runtime_dict; PyObject **cython_runtime_dict;
#endif #endif
if (unlikely(!${cython_runtime_cname})) {
// Very early error where the runtime module is not set up yet.
return c_line;
}
__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_COMPILING_IN_CPYTHON
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment