aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Python/frame.c
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-08-19 16:16:30 +0200
committerGitHub <noreply@github.com>2024-08-19 17:16:30 +0300
commit9b567afd3339f4525feab53873592cb025b14251 (patch)
tree5c8489f98dc5a9a10f66065055e5a401bbd14767 /contrib/tools/python3/Python/frame.c
parent47bd121575c210d4bbb2dddcc2131759a694df05 (diff)
downloadydb-9b567afd3339f4525feab53873592cb025b14251.tar.gz
Library import 240819-0942 (#7994)
Co-authored-by: robot-piglet <robot-piglet@yandex-team.com> Co-authored-by: hiddenpath <hiddenpath@yandex-team.com> Co-authored-by: bulatman <bulatman@yandex-team.com> Co-authored-by: robot-contrib <robot-contrib@yandex-team.com> Co-authored-by: osidorkin <osidorkin@yandex-team.com> Co-authored-by: akhropov <akhropov@yandex-team.com> Co-authored-by: akozhikhov <akozhikhov@yandex-team.com> Co-authored-by: orlovorlov <orlovorlov@yandex-team.com> Co-authored-by: babenko <babenko@yandex-team.com> Co-authored-by: shadchin <shadchin@yandex-team.com> Co-authored-by: dmasloff <dmasloff@yandex-team.com> Co-authored-by: aleksei-le <aleksei-le@yandex-team.com> Co-authored-by: coteeq <coteeq@yandex-team.com> Co-authored-by: dimdim11 <dimdim11@yandex-team.com> Co-authored-by: robot-ya-builder <robot-ya-builder@yandex-team.com> Co-authored-by: iaz1607 <iaz1607@yandex-team.com>
Diffstat (limited to 'contrib/tools/python3/Python/frame.c')
-rw-r--r--contrib/tools/python3/Python/frame.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/contrib/tools/python3/Python/frame.c b/contrib/tools/python3/Python/frame.c
index a49215fa44a..b84fd9b6a93 100644
--- a/contrib/tools/python3/Python/frame.c
+++ b/contrib/tools/python3/Python/frame.c
@@ -116,18 +116,6 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame)
}
void
-_PyFrame_ClearLocals(_PyInterpreterFrame *frame)
-{
- assert(frame->stacktop >= 0);
- int stacktop = frame->stacktop;
- frame->stacktop = 0;
- for (int i = 0; i < stacktop; i++) {
- Py_XDECREF(frame->localsplus[i]);
- }
- Py_CLEAR(frame->f_locals);
-}
-
-void
_PyFrame_ClearExceptCode(_PyInterpreterFrame *frame)
{
/* It is the responsibility of the owning generator/coroutine
@@ -147,8 +135,12 @@ _PyFrame_ClearExceptCode(_PyInterpreterFrame *frame)
}
Py_DECREF(f);
}
- _PyFrame_ClearLocals(frame);
+ assert(frame->stacktop >= 0);
+ for (int i = 0; i < frame->stacktop; i++) {
+ Py_XDECREF(frame->localsplus[i]);
+ }
Py_XDECREF(frame->frame_obj);
+ Py_XDECREF(frame->f_locals);
Py_DECREF(frame->f_funcobj);
}