[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 b9d672491d5082c541bf267eb7bb99fdc6529324)
* bpo-30855: Trying to fix test_use on Windows.
(cherry picked from commit 29a2f7c6b38e5a6ed891aa72af38974a1ff2d372)
(subTest() removed since it was introduced in Python 3)
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index 874e0ef..6198c4c 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -844,8 +844,7 @@
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)