Skip to content

Commit

Permalink
Remove some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNaif2018 committed Oct 15, 2020
1 parent 0b1afb7 commit 1af16b6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bitcart/manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import warnings
from collections import UserDict, defaultdict
from functools import partial
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Optional
Expand Down Expand Up @@ -45,9 +46,11 @@ def __init__(self, wallets: Dict[str, Iterable[str]] = {}):

@classmethod
def load_wallets(cls, currency: str, wallets: Iterable[str]) -> ExtendedDict:
return ExtendedDict(
{wallet: cls.load_wallet(currency, wallet) for wallet in wallets} or {"": cls.load_wallet(currency, None)}
)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
return ExtendedDict(
{wallet: cls.load_wallet(currency, wallet) for wallet in wallets} or {"": cls.load_wallet(currency, None)}
)

@classmethod
def load_wallet(cls, currency: str, wallet: Optional[str]) -> "Coin":
Expand Down Expand Up @@ -90,6 +93,8 @@ async def process_updates(
) -> None:
wallet_obj = self.wallets[currency].get(wallet)
if not wallet_obj:
wallet_obj = self.load_wallet(currency, wallet) # type: ignore
with warnings.catch_warnings():
warnings.simplefilter("ignore")
wallet_obj = self.load_wallet(currency, wallet) # type: ignore
self._merge_event_handlers(wallet_obj)
await wallet_obj.process_updates(updates, pass_instance=True)

0 comments on commit 1af16b6

Please sign in to comment.