From 2286e605a5065e5068e075df2d890ab874e7dd1c Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 30 Jun 2026 16:55:03 +0300 Subject: [PATCH] gh-151881: Skip tk_inactive negativity check on Windows On Windows the inactivity time can overflow to a negative value (Tk ticket 3cb7c4ac72d4). Co-Authored-By: Claude Opus 4.8 --- Lib/test/test_tkinter/test_misc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_tkinter/test_misc.py b/Lib/test/test_tkinter/test_misc.py index e6221f7089704d0..5f75b8d245b3e99 100644 --- a/Lib/test/test_tkinter/test_misc.py +++ b/Lib/test/test_tkinter/test_misc.py @@ -592,7 +592,10 @@ def test_tk_inactive(self): ms = self.root.tk_inactive() self.assertIsInstance(ms, int) # A count of milliseconds, or -1 if the windowing system lacks support. - self.assertGreaterEqual(ms, -1) + if self.root._windowingsystem != 'win32': + # On Windows the value can overflow to a negative number + # (Tk ticket 3cb7c4ac72d4). + self.assertGreaterEqual(ms, -1) # Resetting the timer returns None and does not raise. self.assertIsNone(self.root.tk_inactive(reset=True))