change AST codegen to use PyModule_AddIntMacro

This commit is contained in:
Benjamin Peterson 2013-05-20 10:28:48 -07:00
parent 74ca886788
commit 8d89c2aaba
1 changed files with 1 additions and 1 deletions

View File

@ -1011,7 +1011,7 @@ class ASTModuleVisitor(PickleVisitor):
self.emit("if (!m) return NULL;", 1)
self.emit("d = PyModule_GetDict(m);", 1)
self.emit('if (PyDict_SetItemString(d, "AST", (PyObject*)&AST_type) < 0) return NULL;', 1)
self.emit('if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)', 1)
self.emit('if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0)', 1)
self.emit("return NULL;", 2)
for dfn in mod.dfns:
self.visit(dfn)