diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-01-10 10:53:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-10 10:53:27 (GMT) |
commit | 7530c612d10030cf9d53e70b1acd333c31a97d7f (patch) | |
tree | 40c679a5524f27a09d4b9a6ca8ccf0c0bb1eb73c /Lib/test/test_tkinter/test_misc.py | |
parent | 159e3db1f7697b9aecdf674bb833fbb87f3dcad3 (diff) | |
download | cpython-7530c612d10030cf9d53e70b1acd333c31a97d7f.zip cpython-7530c612d10030cf9d53e70b1acd333c31a97d7f.tar.gz cpython-7530c612d10030cf9d53e70b1acd333c31a97d7f.tar.bz2 |
[3.12] gh-113877: Fix Tkinter method winfo_pathname() on 64-bit Windows (GH-113900) (GH-113901)
winfo_id() converts the result of "winfo id" command to integer, but
"winfo pathname" command requires an argument to be a hexadecimal number
on Win64.
(cherry picked from commit 1b7e0024a16c1820f61c04a8a100498568410afd)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_tkinter/test_misc.py')
-rw-r--r-- | Lib/test/test_tkinter/test_misc.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_tkinter/test_misc.py b/Lib/test/test_tkinter/test_misc.py index a84bb02..f4d51c4 100644 --- a/Lib/test/test_tkinter/test_misc.py +++ b/Lib/test/test_tkinter/test_misc.py @@ -227,6 +227,18 @@ class MiscTest(AbstractTkTest, unittest.TestCase): with self.assertRaises(tkinter.TclError): rgb((111, 78, 55)) + def test_winfo_pathname(self): + t = tkinter.Toplevel(self.root) + w = tkinter.Button(t) + wid = w.winfo_id() + self.assertIsInstance(wid, int) + self.assertEqual(self.root.winfo_pathname(hex(wid)), str(w)) + self.assertEqual(self.root.winfo_pathname(hex(wid), displayof=None), str(w)) + self.assertEqual(self.root.winfo_pathname(hex(wid), displayof=t), str(w)) + self.assertEqual(self.root.winfo_pathname(wid), str(w)) + self.assertEqual(self.root.winfo_pathname(wid, displayof=None), str(w)) + self.assertEqual(self.root.winfo_pathname(wid, displayof=t), str(w)) + def test_event_repr_defaults(self): e = tkinter.Event() e.serial = 12345 |