Commit e222eba0 authored by Stefan Behnel's avatar Stefan Behnel

improve variable name in helper function

parent ea5c0528
...@@ -1964,14 +1964,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1964,14 +1964,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.enter_cfunc_scope() # as we need labels code.enter_cfunc_scope() # as we need labels
code.putln("static int %s(PyObject *o, PyObject* py_name, char *name) {" % Naming.import_star_set) code.putln("static int %s(PyObject *o, PyObject* py_name, char *name) {" % Naming.import_star_set)
code.putln("static const char* type_names[] = {") code.putln("static const char* internal_type_names[] = {")
for name, entry in sorted(env.entries.items()): for name, entry in sorted(env.entries.items()):
if entry.is_type: if entry.is_type:
code.putln('"%s",' % name) code.putln('"%s",' % name)
code.putln("0") code.putln("0")
code.putln("};") code.putln("};")
code.putln("const char** type_name = type_names;") code.putln("const char** type_name = internal_type_names;")
code.putln("while (*type_name) {") code.putln("while (*type_name) {")
code.putln("if (__Pyx_StrEq(name, *type_name)) {") code.putln("if (__Pyx_StrEq(name, *type_name)) {")
code.putln('PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);') code.putln('PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);')
......
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