Commit c7af7f36 authored by Martin v. Löwis's avatar Martin v. Löwis

Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap

Tcl command objects.
Backport of r65399.
parent 4f3be8a0
...@@ -1072,18 +1072,18 @@ class Misc: ...@@ -1072,18 +1072,18 @@ class Misc:
def nametowidget(self, name): def nametowidget(self, name):
"""Return the Tkinter instance of a widget identified by """Return the Tkinter instance of a widget identified by
its Tcl name NAME.""" its Tcl name NAME."""
name = str(name).split('.')
w = self w = self
if name[0] == '.':
if not name[0]:
w = w._root() w = w._root()
name = name[1:] name = name[1:]
while name:
i = name.find('.') for n in name:
if i >= 0: if not n:
name, tail = name[:i], name[i+1:] break
else: w = w.children[n]
tail = ''
w = w.children[name]
name = tail
return w return w
_nametowidget = nametowidget _nametowidget = nametowidget
def _register(self, func, subst=None, needcleanup=1): def _register(self, func, subst=None, needcleanup=1):
......
...@@ -74,6 +74,8 @@ Core and builtins ...@@ -74,6 +74,8 @@ Core and builtins
Library Library
------- -------
- Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap Tcl command objects.
- Issue #3339: dummy_thread.acquire() could return None which is not a valid - Issue #3339: dummy_thread.acquire() could return None which is not a valid
return value. return value.
......
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