File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame)
5252 assert (frame -> owner != FRAME_OWNED_BY_FRAME_OBJECT );
5353 _PyInterpreterFrame * new_frame = (_PyInterpreterFrame * )f -> _f_frame_data ;
5454 _PyFrame_Copy (frame , new_frame );
55+ // _PyFrame_Copy takes the reference to the executable,
56+ // so we need to restore it.
57+ frame -> f_executable = PyStackRef_DUP (new_frame -> f_executable );
5558 f -> f_frame = new_frame ;
5659 new_frame -> owner = FRAME_OWNED_BY_FRAME_OBJECT ;
5760 if (_PyFrame_IsIncomplete (new_frame )) {
@@ -111,9 +114,6 @@ _PyFrame_ClearExceptCode(_PyInterpreterFrame *frame)
111114 PyFrameObject * f = frame -> frame_obj ;
112115 frame -> frame_obj = NULL ;
113116 if (Py_REFCNT (f ) > 1 ) {
114- // take_ownership takes the reference to the executable,
115- // so we need to incref it.
116- PyStackRef_AsPyObjectNew (frame -> f_executable );
117117 take_ownership (f , frame );
118118 Py_DECREF (f );
119119 return ;
You can’t perform that action at this time.
0 commit comments