--- a/eric6/UI/ErrorLogDialog.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/UI/ErrorLogDialog.py Thu Apr 15 18:11:24 2021 +0200 @@ -8,6 +8,7 @@ """ import os +import contextlib from PyQt5.QtCore import pyqtSlot, Qt from PyQt5.QtWidgets import QDialog, QStyle @@ -49,12 +50,10 @@ self.__ui = parent self.__logFile = logFile - try: + with contextlib.suppress(OSError): with open(logFile, "r", encoding="utf-8") as f: txt = f.read() self.logEdit.setPlainText(txt) - except OSError: - pass @pyqtSlot() def on_emailButton_clicked(self):