tbetter error message - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 74d26f5bdcfcd6ca49c00ad6345ab81ca50f8f99 DIR parent 5c59b017ae0a5a693990d410f7441eedbeeb0c93 HTML Author: ThomasV <thomasv@gitorious> Date: Mon, 15 Jun 2015 10:52:03 +0200 better error message Diffstat: M lib/commands.py | 4 ++-- M lib/wallet.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- DIR diff --git a/lib/commands.py b/lib/commands.py t@@ -331,9 +331,9 @@ class Commands: """Import a private key. """ try: addr = self.wallet.import_key(privkey, self.password) - out = "Keypair imported: ", addr + out = "Keypair imported: " + addr except Exception as e: - out = "Error: Keypair import failed: " + str(e) + out = "Error: " + str(e) return out def _resolver(self, x): DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -291,7 +291,7 @@ class Abstract_Wallet(object): return account is not None def import_key(self, sec, password): - assert self.can_import() + assert self.can_import(), 'This wallet cannot import private keys' try: pubkey = public_key_from_private_key(sec) address = public_key_to_bc_address(pubkey.decode('hex'))