From 8689209e0338943dba9b7ff5566b8a420374764c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ta=C5=9Fkaya?= <47358913+isidentical@users.noreply.github.com> Date: Sun, 15 Mar 2020 22:32:17 +0300 Subject: bpo-39969: Remove ast.Param node class as is no longer used (GH-19020) --- Python/compile.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index b92cb445af..dd14023fcc 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3579,10 +3579,10 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) case AugStore: break; case Del: op = DELETE_DEREF; break; - case Param: default: - PyErr_SetString(PyExc_SystemError, - "param invalid for deref variable"); + PyErr_Format(PyExc_SystemError, + "expr_context kind %d should not be possible", + ctx); return 0; } break; @@ -3596,10 +3596,10 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) case AugLoad: case AugStore: break; - case Param: default: - PyErr_SetString(PyExc_SystemError, - "param invalid for local variable"); + PyErr_Format(PyExc_SystemError, + "expr_context kind %d should not be possible", + ctx); return 0; } ADDOP_N(c, op, mangled, varnames); @@ -3614,10 +3614,10 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) case AugLoad: case AugStore: break; - case Param: default: - PyErr_SetString(PyExc_SystemError, - "param invalid for global variable"); + PyErr_Format(PyExc_SystemError, + "expr_context kind %d should not be possible", + ctx); return 0; } break; @@ -3631,10 +3631,10 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) case AugLoad: case AugStore: break; - case Param: default: - PyErr_SetString(PyExc_SystemError, - "param invalid for name variable"); + PyErr_Format(PyExc_SystemError, + "expr_context kind %d should not be possible", + ctx); return 0; } break; @@ -5058,10 +5058,10 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) case Del: ADDOP_NAME(c, DELETE_ATTR, e->v.Attribute.attr, names); break; - case Param: default: - PyErr_SetString(PyExc_SystemError, - "param invalid in attribute expression"); + PyErr_Format(PyExc_SystemError, + "expr_context kind %d should not be possible", + e->v.Attribute.ctx); return 0; } break; @@ -5359,9 +5359,10 @@ compiler_subscript(struct compiler *c, expr_ty e) case AugStore:/* fall through to Store */ case Store: op = STORE_SUBSCR; break; case Del: op = DELETE_SUBSCR; break; - case Param: - PyErr_SetString(PyExc_SystemError, - "param invalid in subscript expression"); + default: + PyErr_Format(PyExc_SystemError, + "expr_context kind %d should not be possible", + ctx); return 0; } if (ctx == AugStore) { -- cgit v1.2.1