[Python-checkins] bpo-37253: Remove PyAST_obj2mod_ex() function (GH-14020)

Miss Islington (bot) webhook-mailer at python.org
Thu Jun 13 03:46:16 EDT 2019


https://github.com/python/cpython/commit/032bf30643fff49b5595b53f9c1ce5b2cd2df504
commit: 032bf30643fff49b5595b53f9c1ce5b2cd2df504
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-06-13T00:46:01-07:00
summary:

bpo-37253: Remove PyAST_obj2mod_ex() function (GH-14020)


PyAST_obj2mod_ex() is similar to PyAST_obj2mod() with an additional
'feature_version' parameter which is unused.
(cherry picked from commit 022ac0a497b668d8b15e34e582a6396ead1a35e1)

Co-authored-by: Victor Stinner <vstinner at redhat.com>

files:
M Include/Python-ast.h
M Parser/asdl_c.py
M Python/Python-ast.c

diff --git a/Include/Python-ast.h b/Include/Python-ast.h
index 490d3b0846ab..62626503403b 100644
--- a/Include/Python-ast.h
+++ b/Include/Python-ast.h
@@ -707,7 +707,6 @@ type_ignore_ty _Py_TypeIgnore(int lineno, string tag, PyArena *arena);
 
 PyObject* PyAST_mod2obj(mod_ty t);
 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);
-mod_ty PyAST_obj2mod_ex(PyObject* ast, PyArena* arena, int mode, int feature_version);
 int PyAST_Check(PyObject* obj);
 
 #ifdef __cplusplus
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 582c6ca57b65..f4fa271b6595 100644
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -1190,11 +1190,6 @@ class PartingShots(StaticVisitor):
 
 /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */
 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
-{
-    return PyAST_obj2mod_ex(ast, arena, mode, PY_MINOR_VERSION);
-}
-
-mod_ty PyAST_obj2mod_ex(PyObject* ast, PyArena* arena, int mode, int feature_version)
 {
     mod_ty res;
     PyObject *req_type[3];
@@ -1280,7 +1275,6 @@ def main(srcfile, dump_module=False):
             f.write("\n")
             f.write("PyObject* PyAST_mod2obj(mod_ty t);\n")
             f.write("mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);\n")
-            f.write("mod_ty PyAST_obj2mod_ex(PyObject* ast, PyArena* arena, int mode, int feature_version);\n")
             f.write("int PyAST_Check(PyObject* obj);\n")
             f.write('\n')
             f.write('#ifdef __cplusplus\n')
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index dc2b1304f1f2..0774c58e2d23 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -8990,11 +8990,6 @@ PyObject* PyAST_mod2obj(mod_ty t)
 
 /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */
 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
-{
-    return PyAST_obj2mod_ex(ast, arena, mode, PY_MINOR_VERSION);
-}
-
-mod_ty PyAST_obj2mod_ex(PyObject* ast, PyArena* arena, int mode, int feature_version)
 {
     mod_ty res;
     PyObject *req_type[3];



More information about the Python-checkins mailing list