aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-09-12 03:27:14 -0600
committerMark Shannon <mark@hotpy.org>2019-09-12 10:27:14 +0100
commit421a72af4deaec96a49a79951b9c2546a2faa13d (patch)
tree482c622c1573f91cf16e23f4171c12ac83fb5881 /Parser/asdl_c.py
parentcloses bpo-37758: Extend unicodedata checksum tests to cover all of Unicode. ... (diff)
downloadcpython-421a72af4deaec96a49a79951b9c2546a2faa13d.tar.gz
cpython-421a72af4deaec96a49a79951b9c2546a2faa13d.tar.bz2
cpython-421a72af4deaec96a49a79951b9c2546a2faa13d.zip
bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API (#14634)
The PyArena type is not part of the limited API, so these headers shouldn't be part of it either.
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-xParser/asdl_c.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 85d96a33f3..6b31ffd831 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -1339,6 +1339,7 @@ def main(srcfile, dump_module=False):
f.write('extern "C" {\n')
f.write('#endif\n')
f.write('\n')
+ f.write('#ifndef Py_LIMITED_API\n')
f.write('#include "asdl.h"\n')
f.write('\n')
f.write('#undef Yield /* undefine macro conflicting with <winbase.h> */\n')
@@ -1353,6 +1354,7 @@ def main(srcfile, dump_module=False):
f.write("PyObject* PyAST_mod2obj(mod_ty t);\n")
f.write("mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);\n")
f.write("int PyAST_Check(PyObject* obj);\n")
+ f.write("#endif /* !Py_LIMITED_API */\n")
f.write('\n')
f.write('#ifdef __cplusplus\n')
f.write('}\n')