Commit f6d6480b authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

[2.7] bpo-30855: Trying to fix test_use on Windows. (#2586)

* bpo-30855: Trying to fix test_use on Windows.

Avoid possible weird behavior of WideInt convertion.
"winfo id" always returns string hexadecimal representation.

(cherry picked from commit b9d67249)

* bpo-30855: Trying to fix test_use on Windows.

(cherry picked from commit 29a2f7c6)
(subTest() removed since it was introduced in Python 3)
parent af6c5474
......@@ -844,8 +844,7 @@ class Misc:
self.tk.call('winfo', 'height', self._w))
def winfo_id(self):
"""Return identifier ID for this widget."""
return self.tk.getint(
self.tk.call('winfo', 'id', self._w))
return int(self.tk.call('winfo', 'id', self._w), 0)
def winfo_interps(self, displayof=0):
"""Return the name of all Tcl interpreters for this display."""
args = ('winfo', 'interps') + self._displayof(displayof)
......
......@@ -88,9 +88,9 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase):
widget = self.create()
self.assertEqual(widget['use'], '')
parent = self.create(container=True)
wid = parent.winfo_id()
wid = hex(parent.winfo_id())
widget2 = self.create(use=wid)
self.assertEqual(int(widget2['use']), wid)
self.assertEqual(widget2['use'], wid)
@add_standard_options(StandardOptionsTests)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment