From 052e61b5fe4a531e514225308eaa5082c9f84ff7 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Tue, 9 May 2023 18:48:12 +0100 Subject: [PATCH] [mypyc] Don't use _PyErr_ChainExceptions on 3.12, since it's deprecated See https://github.com/python/cpython/pull/102935. --- 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