Fix minor conditional issues in yank

This commit is contained in:
Marshall Lochbaum 2016-08-06 20:15:51 -04:00
parent a90662ef83
commit 47969362e1

View File

@ -653,9 +653,11 @@ class CommandDispatcher:
elif what == 'selection':
caret = self._current_widget().caret
s = caret.selection()
if not caret.has_selection() or len(s) == 0:
if not caret.has_selection() or not s:
message.info(self._win_id, "Nothing to yank")
return
else: # pragma: no cover
raise ValueError("Invalid value {!r} for `what'.".format(what))
if sel and utils.supports_selection():
target = "primary selection"