summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2021-12-21 10:12:26 (GMT)
committerGitHub <noreply@github.com>2021-12-21 10:12:26 (GMT)
commitc66fc0fb53b5316dc325fde3bc738890515d38a4 (patch)
treecefb4f322fcd005b46c3a817918ef92e5eae4d2b /Objects/exceptions.c
parente9a01e231aae19fd1249368e477a60bc033b2646 (diff)
downloadcpython-c66fc0fb53b5316dc325fde3bc738890515d38a4.zip
cpython-c66fc0fb53b5316dc325fde3bc738890515d38a4.tar.gz
cpython-c66fc0fb53b5316dc325fde3bc738890515d38a4.tar.bz2
bpo-46107: ExceptionGroup.subgroup()/split() should copy __note__ to the parts (GH-30159)
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 1db49d9..d82340b 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -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: