From c986da58f6415279fc0a5fcf116dc16f3103c6c8 Mon Sep 17 00:00:00 2001 From: Martin Wagner Date: Sun, 7 Nov 2021 17:27:58 +0100 Subject: [PATCH] removed inelegant try/except --- bin/mpdevil | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/mpdevil b/bin/mpdevil index 97f0073..b65c157 100755 --- a/bin/mpdevil +++ b/bin/mpdevil @@ -3770,17 +3770,13 @@ class MainWindow(Gtk.ApplicationWindow): def _on_show_info(self, action, param): widget=self.get_focus() - try: + if hasattr(widget, "show_info") and callable(widget.show_info): widget.show_info() - except AttributeError: - pass def _on_add_to_playlist(self, action, param, mode): widget=self.get_focus() - try: + if hasattr(widget, "add_to_playlist") and callable(widget.add_to_playlist): widget.add_to_playlist(mode) - except AttributeError: - pass def _on_search_button_toggled(self, button): if button.get_active():