eric6/HexEdit/HexEditMainWindow.py

changeset 8240
93b8a353c4bf
parent 8222
5994b80b8760
child 8259
2bbec88047dd
--- a/eric6/HexEdit/HexEditMainWindow.py	Wed Apr 14 19:38:19 2021 +0200
+++ b/eric6/HexEdit/HexEditMainWindow.py	Wed Apr 14 19:59:16 2021 +0200
@@ -8,6 +8,7 @@
 """
 
 import os
+import contextlib
 
 from PyQt5.QtCore import (
     pyqtSignal, pyqtSlot, QFile, QFileInfo, QSize, QCoreApplication, QLocale
@@ -919,12 +920,10 @@
 
             Preferences.setGeometry("HexEditorGeometry", self.saveGeometry())
             
-            try:
+            with contextlib.suppress(ValueError):
                 if self.__fromEric or len(self.__class__.windows) > 1:
                     del self.__class__.windows[
                         self.__class__.windows.index(self)]
-            except ValueError:
-                pass
             
             if not self.__fromEric:
                 Preferences.syncPreferences()

eric ide

mercurial