From 61154794c8279a05168465913416cbd91d9c9532 Mon Sep 17 00:00:00 2001 From: Filip Gospodinov Date: Thu, 26 Apr 2018 06:12:20 +0200 Subject: [PATCH] electrum: cleanup plugin imports `electrum_plugins` is imported in the `electrum` script without being used - I assume it's done to make PyInstaller find that package. But this can be achieved by avoiding the usage of `__import__()` when importing `electrum_plugins` where it's effectively used. --- electrum | 2 -- lib/plugins.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/electrum b/electrum index cb4b6d40f..6bef64b7b 100755 --- a/electrum +++ b/electrum @@ -69,7 +69,6 @@ if is_local or is_android: import imp imp.load_module('electrum', *imp.find_module('lib')) imp.load_module('electrum_gui', *imp.find_module('gui')) - imp.load_module('electrum_plugins', *imp.find_module('plugins')) @@ -84,7 +83,6 @@ from electrum.commands import get_parser, known_commands, Commands, config_varia from electrum import daemon from electrum import keystore from electrum.mnemonic import Mnemonic -import electrum_plugins # get password routine def prompt_password(prompt, confirm=True): diff --git a/lib/plugins.py b/lib/plugins.py index 510189187..3c818ae98 100644 --- a/lib/plugins.py +++ b/lib/plugins.py @@ -50,7 +50,7 @@ class Plugins(DaemonThread): find = imp.find_module('plugins') plugins = imp.load_module('electrum_plugins', *find) else: - plugins = __import__('electrum_plugins') + import electrum_plugins as plugins self.pkgpath = os.path.dirname(plugins.__file__) self.config = config self.hw_wallets = {}