summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
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 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) {