summaryrefslogtreecommitdiffstats
path: root/Parser/asdl_c.py
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-09-12 09:27:14 (GMT)
committerMark Shannon <mark@hotpy.org>2019-09-12 09:27:14 (GMT)
commit421a72af4deaec96a49a79951b9c2546a2faa13d (patch)
tree482c622c1573f91cf16e23f4171c12ac83fb5881 /Parser/asdl_c.py
parent6954be815a16fad11d1d66be576865bbbeb2b97d (diff)
downloadcpython-421a72af4deaec96a49a79951b9c2546a2faa13d.zip
cpython-421a72af4deaec96a49a79951b9c2546a2faa13d.tar.gz
cpython-421a72af4deaec96a49a79951b9c2546a2faa13d.tar.bz2
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 85d96a3..6b31ffd8 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')