From a9488fb120ae4e3b9684b3a66a681e3fb60609f5 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Fri, 2 Jul 2021 18:31:43 +0300 Subject: [PATCH] Don't add nonfunctional proxyconfig plugins in the Settings dialog --- src/bitmessageqt/settings.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/settings.py b/src/bitmessageqt/settings.py index 76b392c4..4173ebd2 100644 --- a/src/bitmessageqt/settings.py +++ b/src/bitmessageqt/settings.py @@ -57,9 +57,16 @@ class SettingsDialog(QtGui.QDialog): pass else: # Append proxy types defined in plugins + # FIXME: this should be a function in mod:`plugin` for ep in pkg_resources.iter_entry_points( 'bitmessage.proxyconfig'): - self.comboBoxProxyType.addItem(ep.name) + try: + ep.load() + except Exception: # it should add only functional plugins + # many possible exceptions, which are don't matter + pass + else: + self.comboBoxProxyType.addItem(ep.name) self.lineEditMaxOutboundConnections.setValidator( QtGui.QIntValidator(0, 8, self.lineEditMaxOutboundConnections))