From 50891af4178152c5d4646da6b072f410a8639446 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 13 Oct 2013 20:57:23 +0200 Subject: [PATCH] simplify C code for setting up public enums --- Cython/Compiler/Nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 8b726f1..0c57f73 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -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))) -- 2.7.4