eric6/UI/NotificationWidget.py

changeset 8243
cc717c2ae956
parent 8218
7c09585bd960
child 8265
0090cfa83159
--- a/eric6/UI/NotificationWidget.py	Thu Apr 15 16:52:05 2021 +0200
+++ b/eric6/UI/NotificationWidget.py	Thu Apr 15 18:11:24 2021 +0200
@@ -8,6 +8,7 @@
 """
 
 from enum import Enum
+import contextlib
 
 from PyQt5.QtCore import Qt, QTimer, QPoint
 from PyQt5.QtWidgets import QFrame, QWidget, QVBoxLayout
@@ -237,12 +238,9 @@
         # delete the notification
         index = self.__layout.indexOf(notification)
         self.__layout.takeAt(index)
-        try:
+        with contextlib.suppress(ValueError):
             self.__notifications.remove(notification)
             notification.deleteLater()
-        except ValueError:
-            # it was already delete by other method; ignore
-            pass
         
         if self.__layout.count():
             self.__adjustSizeAndPosition()

eric ide

mercurial