mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-46107: ExceptionGroup.subgroup()/split() should copy __note__ to the parts (GH-30159)
This commit is contained in:
parent
e9a01e231a
commit
c66fc0fb53
3 changed files with 9 additions and 1 deletions
|
@ -901,6 +901,11 @@ exceptiongroup_subset(
|
|||
}
|
||||
PyException_SetContext(eg, PyException_GetContext(orig));
|
||||
PyException_SetCause(eg, PyException_GetCause(orig));
|
||||
|
||||
PyObject *note = _PyBaseExceptionObject_cast(orig)->note;
|
||||
Py_XINCREF(note);
|
||||
_PyBaseExceptionObject_cast(eg)->note = note;
|
||||
|
||||
*result = eg;
|
||||
return 0;
|
||||
error:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue