From 8d39bbc85d5c801927a9eaa2498bf1ac3d66659e Mon Sep 17 00:00:00 2001 From: Brett Simmers Date: Mon, 11 Mar 2024 08:46:27 -0400 Subject: [PATCH] Clarify test_flags in normal builds --- Lib/test/_test_embed_set_config.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Lib/test/_test_embed_set_config.py b/Lib/test/_test_embed_set_config.py index 8c818bf1b08e37..5ff521892cb6fe 100644 --- a/Lib/test/_test_embed_set_config.py +++ b/Lib/test/_test_embed_set_config.py @@ -217,8 +217,13 @@ def test_flags(self): self.assertEqual(sys.flags.gil, None) self.set_config(enable_gil=0) self.assertEqual(sys.flags.gil, 0) - self.set_config(enable_gil=1) - self.assertEqual(sys.flags.gil, 1) + self.set_config(enable_gil=1) + self.assertEqual(sys.flags.gil, 1) + else: + # Builds without Py_GIL_DISABLED don't have + # PyConfig.enable_gil. sys.flags.gil is always defined to 1, for + # consistency. + self.assertEqual(sys.flags.gil, 1) def test_options(self): self.check(warnoptions=[])