diff options
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r-- | Objects/frameobject.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 078fcfc..4dd2183 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -192,6 +192,11 @@ mark_stacks(PyCodeObject *code_obj, int len) stacks[i] = UNINITIALIZED; } stacks[0] = 0; + if (code_obj->co_flags & (CO_GENERATOR | CO_COROUTINE | CO_ASYNC_GENERATOR)) + { + // Generators get sent None while starting: + stacks[0] = push_value(stacks[0], Object); + } int todo = 1; while (todo) { todo = 0; @@ -291,9 +296,6 @@ mark_stacks(PyCodeObject *code_obj, int len) case RERAISE: /* End of block */ break; - case GEN_START: - stacks[i+1] = next_stack; - break; default: { int delta = PyCompile_OpcodeStackEffect(opcode, _Py_OPARG(code[i])); |