move raising OperationalException to get_markets()
This commit is contained in:
parent
be70c4f959
commit
3a78d4c886
@ -208,7 +208,9 @@ class Exchange(object):
|
||||
if this was requested in parameters.
|
||||
"""
|
||||
markets = self.markets
|
||||
if markets is not None:
|
||||
if markets is None:
|
||||
raise OperationalException(f"No markets data available for exchange \"{self.name}\"")
|
||||
else:
|
||||
if base_currency:
|
||||
markets = {k: v for k, v in markets.items() if v['base'] == base_currency}
|
||||
if quote_currency:
|
||||
|
@ -68,9 +68,6 @@ def start_list_pairs(args: Namespace, pairs_only: bool = False) -> None:
|
||||
pairs_only=pairs_only,
|
||||
active_only=args.active_only)
|
||||
|
||||
if pairs is None:
|
||||
raise OperationalException(f"No markets info available for exchange \"{exchange.name}\"")
|
||||
|
||||
if args.print_list:
|
||||
# print data as a list
|
||||
print(f"Exchange {exchange.name} has {len(pairs)} " +
|
||||
|
Loading…
Reference in New Issue
Block a user