Skip to content

Commit 8d445ae

Browse files
committed
PRINT_EXPR
1 parent 05caa7e commit 8d445ae

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
@@ -550,21 +550,19 @@ dummy_func(
550550
ERROR_IF(err != 0, error);
551551
}
552552

553-
// stack effect: (__0 -- )
554-
inst(PRINT_EXPR) {
555-
PyObject *value = POP();
553+
inst(PRINT_EXPR, (value --)) {
556554
PyObject *hook = _PySys_GetAttr(tstate, &_Py_ID(displayhook));
557555
PyObject *res;
556+
// Can't use ERROR_IF here.
558557
if (hook == NULL) {
559558
_PyErr_SetString(tstate, PyExc_RuntimeError,
560559
"lost sys.displayhook");
561560
Py_DECREF(value);
562-
goto error;
561+
ERROR_IF(1, error);
563562
}
564563
res = PyObject_CallOneArg(hook, value);
565564
Py_DECREF(value);
566-
if (res == NULL)
567-
goto error;
565+
ERROR_IF(res == NULL, error);
568566
Py_DECREF(res);
569567
}
570568

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)