Skip to content

Commit f7a4aaf

Browse files
committed
update error logic
1 parent 8439f99 commit f7a4aaf

8 files changed

Lines changed: 90 additions & 35 deletions

File tree

Doc/tools/removed-ids.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ c-api/file.html: deprecated-api
66

77
# Removed sections
88
library/asyncio-task.html: terminating-a-task-group
9+
library/dis.html: opcode-DELETE_GLOBAL
910
deprecations/index.html: pending-removal-in-python-3-15
1011
deprecations/index.html: pending-removal-in-python-3-16
1112
deprecations/index.html: c-api-pending-removal-in-python-3-15

Include/internal/pycore_opcode_metadata.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_metadata.h

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

Modules/_testinternalcapi/test_cases.c.h

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

Python/bytecodes.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,22 +2191,19 @@ dummy_func(
21912191
PyObject *name = GETITEM(FRAME_CO_NAMES, oparg);
21922192
int err;
21932193
if (PyStackRef_IsNull(v)) {
2194-
err = PyDict_Pop(GLOBALS(), name, NULL);
21952194
DEAD(v);
2196-
if (err < 0) {
2197-
ERROR_NO_POP();
2198-
}
2195+
err = PyDict_Pop(GLOBALS(), name, NULL);
21992196
if (err == 0) {
2197+
err = -1;
22002198
_PyEval_FormatExcCheckArg(tstate, PyExc_NameError,
22012199
NAME_ERROR_MSG, name);
2202-
ERROR_NO_POP();
22032200
}
22042201
}
22052202
else {
22062203
err = PyDict_SetItem(GLOBALS(), name, PyStackRef_AsPyObjectBorrow(v));
22072204
PyStackRef_CLOSE(v);
2208-
ERROR_IF(err);
22092205
}
2206+
ERROR_IF(err < 0);
22102207
}
22112208

22122209
inst(LOAD_LOCALS, ( -- locals)) {

Python/executor_cases.c.h

Lines changed: 49 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

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

Python/optimizer_cases.c.h

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)