--- a/eric6/Plugins/PluginVcsMercurial.py Wed Apr 14 19:38:19 2021 +0200 +++ b/eric6/Plugins/PluginVcsMercurial.py Wed Apr 14 19:59:16 2021 +0200 @@ -8,6 +8,7 @@ """ import os +import contextlib from PyQt5.QtCore import QObject, QCoreApplication, QByteArray @@ -197,11 +198,9 @@ from VcsPlugins.vcsMercurial.ProjectHelper import HgProjectHelper self.__projectHelperObject = HgProjectHelper(None, None) - try: + with contextlib.suppress(KeyError): e5App().registerPluginObject( pluginTypename, self.__projectHelperObject, pluginType) - except KeyError: - pass # ignore duplicate registration readShortcuts(pluginName=pluginTypename) def getProjectHelper(self):