diff options
author | serge-sans-paille <serge.guelton@telecom-bretagne.eu> | 2022-09-20 10:00:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 10:00:34 (GMT) |
commit | fc05107af9f20b9d926dedc5bf12d75b0eaa45a3 (patch) | |
tree | fe4f97cfa2b2b885cd798101085586ce92b20564 /Python/ceval.c | |
parent | 6ad47b41a650a13b4a9214309c10239726331eb8 (diff) | |
download | cpython-fc05107af9f20b9d926dedc5bf12d75b0eaa45a3.zip cpython-fc05107af9f20b9d926dedc5bf12d75b0eaa45a3.tar.gz cpython-fc05107af9f20b9d926dedc5bf12d75b0eaa45a3.tar.bz2 |
gh-96711: Enhance SystemError message upon Invalid opcode (#96712)
Raise verbose SystemError instead of printing debug information
upon Invalid opcode.
Fix #96711
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index a07fb49..83c1e1c 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -5051,9 +5051,11 @@ handle_eval_breaker: /* Tell C compilers not to hold the opcode variable in the loop. next_instr points the current instruction without TARGET(). */ opcode = _Py_OPCODE(*next_instr); - fprintf(stderr, "XXX lineno: %d, opcode: %d\n", - _PyInterpreterFrame_GetLine(frame), opcode); - _PyErr_SetString(tstate, PyExc_SystemError, "unknown opcode"); + _PyErr_Format(tstate, PyExc_SystemError, + "%U:%d: unknown opcode %d", + frame->f_code->co_filename, + _PyInterpreterFrame_GetLine(frame), + opcode); goto error; } /* End instructions */ |