mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148)
Co-Authored-By: Yury Selivanov <yury@magic.io>
This commit is contained in:
parent
aa32a7e111
commit
565b4f1ac7
7 changed files with 109 additions and 8 deletions
|
@ -1000,6 +1000,8 @@ 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_AddIntMacro(m, PyCF_ALLOW_TOP_LEVEL_AWAIT) < 0)', 1)
|
||||
self.emit("return NULL;", 2)
|
||||
self.emit('if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0)', 1)
|
||||
self.emit("return NULL;", 2)
|
||||
self.emit('if (PyModule_AddIntMacro(m, PyCF_TYPE_COMMENTS) < 0)', 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue