mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
qt console: fix commands that do not expect a 'wallet' arg
This commit is contained in:
parent
b9af8bf60a
commit
1b332748c3
1 changed files with 6 additions and 0 deletions
|
@ -32,6 +32,7 @@ import ast
|
||||||
import base64
|
import base64
|
||||||
import operator
|
import operator
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import inspect
|
||||||
from functools import wraps, partial
|
from functools import wraps, partial
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import Optional, TYPE_CHECKING, Dict
|
from typing import Optional, TYPE_CHECKING, Dict
|
||||||
|
@ -144,6 +145,11 @@ class Commands:
|
||||||
if cmd.requires_password:
|
if cmd.requires_password:
|
||||||
kwargs['password'] = 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)
|
coro = f(*args, **kwargs)
|
||||||
fut = asyncio.run_coroutine_threadsafe(coro, asyncio.get_event_loop())
|
fut = asyncio.run_coroutine_threadsafe(coro, asyncio.get_event_loop())
|
||||||
result = fut.result()
|
result = fut.result()
|
||||||
|
|
Loading…
Add table
Reference in a new issue