diff options
author | Mark Shannon <mark@hotpy.org> | 2023-02-23 10:19:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-23 10:19:01 (GMT) |
commit | 22b8d77b98a5944e688be0927b8139c49d4a7257 (patch) | |
tree | c3693ee3bc939140e9ad885677d58cab59673993 /Python/frame.c | |
parent | 572223f9ce99e8816abdcc1536db6c4ceed2d848 (diff) | |
download | cpython-22b8d77b98a5944e688be0927b8139c49d4a7257.zip cpython-22b8d77b98a5944e688be0927b8139c49d4a7257.tar.gz cpython-22b8d77b98a5944e688be0927b8139c49d4a7257.tar.bz2 |
GH-100719: Remove redundant `gi_code` field from generator object. (GH-100749)
Diffstat (limited to 'Python/frame.c')
-rw-r--r-- | Python/frame.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/frame.c b/Python/frame.c index 6a287d4..b562709 100644 --- a/Python/frame.c +++ b/Python/frame.c @@ -84,6 +84,7 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame) assert(frame->owner != FRAME_OWNED_BY_FRAME_OBJECT); assert(frame->owner != FRAME_CLEARED); Py_ssize_t size = ((char*)&frame->localsplus[frame->stacktop]) - (char *)frame; + Py_INCREF(frame->f_code); memcpy((_PyInterpreterFrame *)f->_f_frame_data, frame, size); frame = (_PyInterpreterFrame *)f->_f_frame_data; f->f_frame = frame; @@ -118,7 +119,7 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame) } void -_PyFrame_Clear(_PyInterpreterFrame *frame) +_PyFrame_ClearExceptCode(_PyInterpreterFrame *frame) { /* It is the responsibility of the owning generator/coroutine * to have cleared the enclosing generator, if any. */ @@ -144,7 +145,6 @@ _PyFrame_Clear(_PyInterpreterFrame *frame) Py_XDECREF(frame->frame_obj); Py_XDECREF(frame->f_locals); Py_DECREF(frame->f_funcobj); - Py_DECREF(frame->f_code); } int |