From b1b0193e92b78440843df17ccbc79d3347f6e22d Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Wed, 16 Aug 2023 11:17:41 -0700 Subject: [PATCH] avoid while True --- Lib/test/test_capi/test_watchers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_capi/test_watchers.py b/Lib/test/test_capi/test_watchers.py index 236f439cc20923..6b8855ec219d27 100644 --- a/Lib/test/test_capi/test_watchers.py +++ b/Lib/test/test_capi/test_watchers.py @@ -353,7 +353,7 @@ def test_clear_unassigned_watcher_id(self): def test_no_more_ids_available(self): with self.assertRaisesRegex(RuntimeError, r"no more type watcher IDs"): with ExitStack() as stack: - while True: + for _ in range(self.TYPE_MAX_WATCHERS + 1): stack.enter_context(self.watcher())