From c0e6d2818bcab9a7313cebb54463d752004de844 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 19 Jun 2023 23:42:19 +0100 Subject: [PATCH] [mypyc] Don't use _PyErr_ChainExceptions on 3.12, since it's deprecated (#15468) --- mypyc/lib-rt/exc_ops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mypyc/lib-rt/exc_ops.c b/mypyc/lib-rt/exc_ops.c index 219914bf3470..a7536994d059 100644 --- a/mypyc/lib-rt/exc_ops.c +++ b/mypyc/lib-rt/exc_ops.c @@ -230,7 +230,11 @@ void CPy_AddTraceback(const char *filename, const char *funcname, int line, PyOb return; error: +#if CPY_3_12_FEATURES + _PyErr_ChainExceptions1(exc); +#else _PyErr_ChainExceptions(exc, val, tb); +#endif } CPy_NOINLINE