--- a/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py Wed Apr 14 19:38:19 2021 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py Wed Apr 14 19:59:16 2021 +0200 @@ -9,6 +9,7 @@ import os import shutil +import contextlib from PyQt5.QtCore import ( pyqtSignal, QFileInfo, QFileSystemWatcher, QCoreApplication @@ -1140,10 +1141,8 @@ entries.extend(Utilities.direntries(name, True, pat)) for entry in entries: - try: + with contextlib.suppress(OSError): os.remove(entry) - except OSError: - pass def vcsCommandLine(self, name): """