summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorMatthias Bussonnier <bussonniermatthias@gmail.com>2019-05-21 20:12:03 (GMT)
committerYury Selivanov <yury@magic.io>2019-05-21 20:12:02 (GMT)
commit565b4f1ac7304d1e690c404ca8316f383ba60862 (patch)
tree193faa5ced2666a1fba1b3715c89946398ccbb12 /Parser
parentaa32a7e1116f7aaaef9fec453db910e90ab7b101 (diff)
downloadcpython-565b4f1ac7304d1e690c404ca8316f383ba60862.zip
cpython-565b4f1ac7304d1e690c404ca8316f383ba60862.tar.gz
cpython-565b4f1ac7304d1e690c404ca8316f383ba60862.tar.bz2
bpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148)
Co-Authored-By: Yury Selivanov <yury@magic.io>
Diffstat (limited to 'Parser')
-rw-r--r--Parser/asdl_c.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 4091b6d..cb0e6d7 100644
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -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)