]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-151881: Skip tk_inactive negativity check on Windows (GH-152683)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 30 Jun 2026 14:25:42 +0000 (17:25 +0300)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2026 14:25:42 +0000 (14:25 +0000)
On Windows the inactivity time can overflow to a negative value
(Tk ticket 3cb7c4ac72d4).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_tkinter/test_misc.py

index e6221f7089704d0e0d1d471919b1897ffad1c98c..5f75b8d245b3e992d86b7a27922695e8d558a367 100644 (file)
@@ -592,7 +592,10 @@ class MiscTest(AbstractTkTest, unittest.TestCase):
         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))