Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2283010

Browse files
authored
gh-131173: Improve exception handling during take_ownership processing (#132620)
Save and restore exceptions during take_ownership processing to preserveexceptions currently being raised.Co-authored-by: alperyoney <alperyoney@fb.com>
1 parent1d529cb commit2283010

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎Python/frame.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame)
6969
_PyInterpreterFrame*prev=_PyFrame_GetFirstComplete(frame->previous);
7070
if (prev) {
7171
assert(prev->owner<FRAME_OWNED_BY_INTERPRETER);
72+
PyObject*exc=PyErr_GetRaisedException();
7273
/* Link PyFrameObjects.f_back and remove link through _PyInterpreterFrame.previous */
7374
PyFrameObject*back=_PyFrame_GetFrameObject(prev);
7475
if (back==NULL) {
@@ -80,6 +81,7 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame)
8081
else {
8182
f->f_back= (PyFrameObject*)Py_NewRef(back);
8283
}
84+
PyErr_SetRaisedException(exc);
8385
}
8486
if (!_PyObject_GC_IS_TRACKED((PyObject*)f)) {
8587
_PyObject_GC_TRACK((PyObject*)f);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp