mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
bpo-44404: tkinter after
support callable classes (GH-26812)
This commit is contained in:
parent
5c7940257e
commit
e9c8f784fa
3 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
import functools
|
||||
import unittest
|
||||
import tkinter
|
||||
import enum
|
||||
|
@ -98,6 +99,12 @@ class MiscTest(AbstractTkTest, unittest.TestCase):
|
|||
with self.assertRaises(tkinter.TclError):
|
||||
root.tk.call(script)
|
||||
|
||||
# Call with a callable class
|
||||
count = 0
|
||||
timer1 = root.after(0, functools.partial(callback, 42, 11))
|
||||
root.update() # Process all pending events.
|
||||
self.assertEqual(count, 53)
|
||||
|
||||
def test_after_idle(self):
|
||||
root = self.root
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue