changeset 1676:a0810e0f386e

primitivus: a warning is loggued when trying to remove an unknown popup, instead of an error raised
author Goffi <goffi@goffi.org>
date Wed, 25 Nov 2015 13:03:44 +0100
parents fd143578fe89
children a125b11af711
files frontends/src/primitivus/primitivus
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/primitivus/primitivus	Wed Nov 25 13:03:10 2015 +0100
+++ b/frontends/src/primitivus/primitivus	Wed Nov 25 13:03:44 2015 +0100
@@ -502,7 +502,10 @@
             if isinstance(self.loop.widget, urwid.Overlay):
                 current_popup = self.loop.widget.top_w
                 if not current_popup == widget:
-                    self.notif_bar.removePopUp(widget)
+                    try:
+                        self.notif_bar.removePopUp(widget)
+                    except ValueError:
+                        log.warning(u"Trying to remove an unknown widget {}".format(widget))
                     return
         self.loop.widget = self.main_widget
         next_popup = self.notif_bar.getNextPopup()