summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-10-26 15:30:18 (GMT)
committerGitHub <noreply@github.com>2023-10-26 15:30:18 (GMT)
commita0c414c35d0dc0d44a885fda448652e23de2482c (patch)
tree014f5cb67924fcc0ac17d97aeb879dc05a6ccac0 /Objects
parent309efb39dc005a834bb67e9a6f27b6689f00ec9d (diff)
downloadcpython-a0c414c35d0dc0d44a885fda448652e23de2482c.zip
cpython-a0c414c35d0dc0d44a885fda448652e23de2482c.tar.gz
cpython-a0c414c35d0dc0d44a885fda448652e23de2482c.tar.bz2
gh-111354: define names for RESUME oparg values (#111365)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/genobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 092fd5f..1477139 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -10,6 +10,7 @@
#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_opcode_metadata.h" // _PyOpcode_Caches
+#include "pycore_opcode_utils.h" // RESUME_AFTER_YIELD_FROM
#include "pycore_pyerrors.h" // _PyErr_ClearExcState()
#include "pycore_pystate.h" // _PyThreadState_GET()
@@ -363,7 +364,7 @@ _PyGen_yf(PyGenObject *gen)
assert(_PyCode_CODE(_PyGen_GetCode(gen))[0].op.code != SEND);
return NULL;
}
- if (!is_resume(frame->instr_ptr) || frame->instr_ptr->op.arg < 2)
+ if (!is_resume(frame->instr_ptr) || frame->instr_ptr->op.arg < RESUME_AFTER_YIELD_FROM)
{
/* Not in a yield from */
return NULL;