From 6b4538192ddac518b9c15b3f79445c964330dee3 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Tue, 27 Jan 2026 16:38:50 -0500 Subject: [PATCH] gh-120321: Add missing "return false" in gen_try_set_executing (gh-144291) We didn't catch this because of a combination of: 1) falling through to the if-statement below works 2) we only specialized FOR_ITER_GEN for uniquely referenced generators, so we didn't trigger the non-thread-safe behavior. --- Python/ceval_macros.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index d791ba0e8eca..79ec80329165 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -529,6 +529,7 @@ gen_try_set_executing(PyGenObject *gen) return true; } } + return false; } #endif // Use faster non-atomic modifications in the GIL-enabled build and when -- 2.47.3