Skip to content

Commit 11b5e57

Browse files
committed
PRINT_EXPR
1 parent 9ad64b0 commit 11b5e57

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

Python/bytecodes.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -545,21 +545,19 @@ dummy_func(
545545
ERROR_IF(err != 0, error);
546546
}
547547

548-
// stack effect: (__0 -- )
549-
inst(PRINT_EXPR) {
550-
PyObject *value = POP();
548+
inst(PRINT_EXPR, (value --)) {
551549
PyObject *hook = _PySys_GetAttr(tstate, &_Py_ID(displayhook));
552550
PyObject *res;
551+
// Can't use ERROR_IF here.
553552
if (hook == NULL) {
554553
_PyErr_SetString(tstate, PyExc_RuntimeError,
555554
"lost sys.displayhook");
556555
Py_DECREF(value);
557-
goto error;
556+
ERROR_IF(1, error);
558557
}
559558
res = PyObject_CallOneArg(hook, value);
560559
Py_DECREF(value);
561-
if (res == NULL)
562-
goto error;
560+
ERROR_IF(res == NULL, error);
563561
Py_DECREF(res);
564562
}
565563

Python/generated_cases.c.h

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)