From 4ec3b7f344ca5a23cace8ff8d456dfc42e4a9311 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 11 Oct 2024 11:26:33 +0200 Subject: [PATCH] find_external_plugins: fix for python versions < 3.10 --- electrum/plugin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/electrum/plugin.py b/electrum/plugin.py index 81213dd31..c567c26b1 100644 --- a/electrum/plugin.py +++ b/electrum/plugin.py @@ -207,8 +207,13 @@ class Plugins(DaemonThread): raise Exception(f"duplicate plugins for name={name}") if name in self.external_plugin_metadata: raise Exception(f"duplicate plugins for name={name}") - spec = zipfile.find_spec(name) - module = self.exec_module_from_spec(spec, f'electrum_external_plugins.{name}') + module_path = f'electrum_external_plugins.{name}' + if sys.version_info >= (3, 10): + spec = zipfile.find_spec(name) + module = self.exec_module_from_spec(spec, module_path) + else: + module = zipfile.load_module(name) + sys.modules[module_path] = module d = module.__dict__ gui_good = self.gui_name in d.get('available_for', []) if not gui_good: