Commit 2075746f authored by Stefan Behnel's avatar Stefan Behnel

avoid useless indirection for module dict lookup and instead use known reference directly

parent 9aab6383
......@@ -99,9 +99,7 @@ static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals)
char *code = 0;
if (!globals || globals == Py_None) {
globals = PyModule_GetDict($module_cname);
if (!globals)
goto bad;
globals = $moddict_cname;
} else if (!PyDict_Check(globals)) {
PyErr_Format(PyExc_TypeError, "exec() arg 2 must be a dict, not %.200s",
Py_TYPE(globals)->tp_name);
......
......@@ -514,12 +514,10 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
if (!py_code) goto bad;
$global_code_object_cache_insert(c_line ? c_line : py_line, py_code);
}
py_globals = PyModule_GetDict($module_cname);
if (!py_globals) goto bad;
py_frame = PyFrame_New(
PyThreadState_GET(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
py_globals, /*PyObject *globals,*/
$moddict_cname, /*PyObject *globals,*/
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
......
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