tqt console: fix commands that do not expect a 'wallet' arg - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 1b332748c3ef641ecb94e8cbaefd4c2483b6993f DIR parent b9af8bf60a9731e2f60b05b5d824b4c258196c7c HTML Author: SomberNight <somber.night@protonmail.com> Date: Thu, 12 Sep 2019 19:22:55 +0200 qt console: fix commands that do not expect a 'wallet' arg Diffstat: M electrum/commands.py | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) --- DIR diff --git a/electrum/commands.py b/electrum/commands.py t@@ -32,6 +32,7 @@ import ast import base64 import operator import asyncio +import inspect from functools import wraps, partial from decimal import Decimal from typing import Optional, TYPE_CHECKING, Dict t@@ -144,6 +145,11 @@ class Commands: if cmd.requires_password: kwargs['password'] = password + if 'wallet' in kwargs: + sig = inspect.signature(f) + if 'wallet' not in sig.parameters: + kwargs.pop('wallet') + coro = f(*args, **kwargs) fut = asyncio.run_coroutine_threadsafe(coro, asyncio.get_event_loop()) result = fut.result()