simplify C code for setting up public enums
authorStefan Behnel <stefan_ml@behnel.de>
Sun, 13 Oct 2013 18:57:23 +0000 (20:57 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Sun, 13 Oct 2013 18:57:23 +0000 (20:57 +0200)
Cython/Compiler/Nodes.py

index 8b726f1..0c57f73 100644 (file)
@@ -1368,8 +1368,8 @@ class CEnumDefNode(StatNode):
                         item.cname,
                         code.error_goto_if_null(temp, item.pos)))
                 code.put_gotref(temp)
-                code.putln('if (__Pyx_SetAttrString(%s, "%s", %s) < 0) %s' % (
-                        Naming.module_cname,
+                code.putln('if (PyDict_SetItemString(%s, "%s", %s) < 0) %s' % (
+                        Naming.moddict_cname,
                         item.name,
                         temp,
                         code.error_goto(item.pos)))