]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35766 follow-up: Kill half-support for FunctionType in PyAST_obj2mod (#11714)
authorGuido van Rossum <guido@python.org>
Fri, 1 Feb 2019 19:37:34 +0000 (11:37 -0800)
committerGitHub <noreply@github.com>
Fri, 1 Feb 2019 19:37:34 +0000 (11:37 -0800)
See https://github.com/python/cpython/pull/11645/files/229874c612df868e7ae3e997e159915f49d16542#r252631862

https://bugs.python.org/issue35766

Parser/asdl_c.py
Python/Python-ast.c

index a51a5db739044a0ef0de292163208e2a4743c1c4..1526995e3f8b559620acfa46b3c7cd519139face 100644 (file)
@@ -1187,19 +1187,18 @@ PyObject* PyAST_mod2obj(mod_ty t)
 }
 
 /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */
-/* and 3 for "func_type" */
 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
 {
     mod_ty res;
     PyObject *req_type[3];
-    char *req_name[] = {"Module", "Expression", "Interactive", "FunctionType"};
+    char *req_name[] = {"Module", "Expression", "Interactive"};
     int isinstance;
 
     req_type[0] = (PyObject*)Module_type;
     req_type[1] = (PyObject*)Expression_type;
     req_type[2] = (PyObject*)Interactive_type;
 
-    assert(0 <= mode && mode <= 3);
+    assert(0 <= mode && mode <= 2);
 
     if (!init_types())
         return NULL;
index 1a56e90bca09aa09d61a589cfbc1b56c36be4aaf..5467d192ee69c07443bd39150df550dcca6842f1 100644 (file)
@@ -8917,19 +8917,18 @@ PyObject* PyAST_mod2obj(mod_ty t)
 }
 
 /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */
-/* and 3 for "func_type" */
 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
 {
     mod_ty res;
     PyObject *req_type[3];
-    char *req_name[] = {"Module", "Expression", "Interactive", "FunctionType"};
+    char *req_name[] = {"Module", "Expression", "Interactive"};
     int isinstance;
 
     req_type[0] = (PyObject*)Module_type;
     req_type[1] = (PyObject*)Expression_type;
     req_type[2] = (PyObject*)Interactive_type;
 
-    assert(0 <= mode && mode <= 3);
+    assert(0 <= mode && mode <= 2);
 
     if (!init_types())
         return NULL;