Skip to content

Commit 2286e60

Browse files
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 <noreply@anthropic.com>
1 parent ecdef17 commit 2286e60

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/test/test_tkinter/test_misc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,10 @@ def test_tk_inactive(self):
592592
ms = self.root.tk_inactive()
593593
self.assertIsInstance(ms, int)
594594
# A count of milliseconds, or -1 if the windowing system lacks support.
595-
self.assertGreaterEqual(ms, -1)
595+
if self.root._windowingsystem != 'win32':
596+
# On Windows the value can overflow to a negative number
597+
# (Tk ticket 3cb7c4ac72d4).
598+
self.assertGreaterEqual(ms, -1)
596599
# Resetting the timer returns None and does not raise.
597600
self.assertIsNone(self.root.tk_inactive(reset=True))
598601

0 commit comments

Comments
 (0)