From 5bd047b70b2e2f48d5191ef76505bd3154cbed83 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Sun, 12 Feb 2017 18:03:49 -0500 Subject: [PATCH] Fix CompletionView.completion_item_del for new API. The new function based completion models work a little differently so the view needed slightly different error handling. --- qutebrowser/completion/completionwidget.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index f12027340..3d2aef27e 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -368,7 +368,7 @@ class CompletionView(QTreeView): """Delete the current completion item.""" if not self.currentIndex().isValid(): raise cmdexc.CommandError("No item selected!") - try: - self.model().srcmodel.delete_cur_item(self) - except NotImplementedError: + if self.model().srcmodel.delete_cur_item is None: raise cmdexc.CommandError("Cannot delete this item.") + else: + self.model().srcmodel.delete_cur_item(self)