eric6/Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 8240
93b8a353c4bf
parent 8234
fcb6b4b96274
child 8243
cc717c2ae956
--- 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):
         """

eric ide

mercurial