summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorBatuhan Taşkaya <47358913+isidentical@users.noreply.github.com>2020-03-15 19:32:17 (GMT)
committerGitHub <noreply@github.com>2020-03-15 19:32:17 (GMT)
commit8689209e0338943dba9b7ff5566b8a420374764c (patch)
tree85b8eaa7a411ad1012628f17a56ae899c4ab19c5 /Python/compile.c
parent61ac612e78e4f2625977406fb6f366e0a644673a (diff)
downloadcpython-8689209e0338943dba9b7ff5566b8a420374764c.zip
cpython-8689209e0338943dba9b7ff5566b8a420374764c.tar.gz
cpython-8689209e0338943dba9b7ff5566b8a420374764c.tar.bz2
bpo-39969: Remove ast.Param node class as is no longer used (GH-19020)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/Python/compile.c b/Python/compile.c
index b92cb44..dd14023 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) {