mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
change AST codegen to use PyModule_AddIntMacro
This commit is contained in:
parent
74ca886788
commit
8d89c2aaba
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue