Commit ab805949 authored by Stefan Behnel's avatar Stefan Behnel

simplify __Pyx_Globals() a little

parent 0624c00a
...@@ -21,14 +21,9 @@ static PyObject* __Pyx_Globals(void); /*proto*/ ...@@ -21,14 +21,9 @@ static PyObject* __Pyx_Globals(void); /*proto*/
static PyObject* __Pyx_Globals(void) { static PyObject* __Pyx_Globals(void) {
Py_ssize_t i; Py_ssize_t i;
//PyObject *d; PyObject *names;
PyObject *names = NULL; PyObject *globals = $moddict_cname;
PyObject *globals = PyObject_GetAttr($module_cname, PYIDENT("__dict__")); Py_INCREF(globals);
if (!globals) {
PyErr_SetString(PyExc_TypeError,
"current module must have __dict__ attribute");
goto bad;
}
names = PyObject_Dir($module_cname); names = PyObject_Dir($module_cname);
if (!names) if (!names)
goto bad; goto bad;
...@@ -62,9 +57,6 @@ static PyObject* __Pyx_Globals(void) { ...@@ -62,9 +57,6 @@ static PyObject* __Pyx_Globals(void) {
} }
Py_DECREF(names); Py_DECREF(names);
return globals; return globals;
// d = PyDictProxy_New(globals);
// Py_DECREF(globals);
// return d;
bad: bad:
Py_XDECREF(names); Py_XDECREF(names);
Py_XDECREF(globals); Py_XDECREF(globals);
......
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