Kaydet (Commit) 76f587b7 authored tarafından Guido van Rossum's avatar Guido van Rossum

Avoid traceback in selection_own_get() when no Tk widget owns the

selection; return None instead.
üst b7cf5bb1
......@@ -267,9 +267,10 @@ class Misc:
def selection_own_get(self, **kw):
"Find owner of X selection."
if not kw.has_key('displayof'): kw['displayof'] = self._w
return self._nametowidget(
apply(self.tk.call,
('selection', 'own') + self._options(kw)))
name = apply(self.tk.call,
('selection', 'own') + self._options(kw))
if not name: return None
return self._nametowidget(name)
def send(self, interp, cmd, *args):
return apply(self.tk.call, ('send', interp, cmd) + args)
def lower(self, belowThis=None):
......
......@@ -267,9 +267,10 @@ class Misc:
def selection_own_get(self, **kw):
"Find owner of X selection."
if not kw.has_key('displayof'): kw['displayof'] = self._w
return self._nametowidget(
apply(self.tk.call,
('selection', 'own') + self._options(kw)))
name = apply(self.tk.call,
('selection', 'own') + self._options(kw))
if not name: return None
return self._nametowidget(name)
def send(self, interp, cmd, *args):
return apply(self.tk.call, ('send', interp, cmd) + args)
def lower(self, belowThis=None):
......
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