move raising OperationalException to get_markets()

This commit is contained in:
hroff-1902 2019-07-03 13:24:28 +03:00
parent be70c4f959
commit 3a78d4c886
2 changed files with 3 additions and 4 deletions

View File

@ -208,7 +208,9 @@ class Exchange(object):
if this was requested in parameters. if this was requested in parameters.
""" """
markets = self.markets 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: if base_currency:
markets = {k: v for k, v in markets.items() if v['base'] == base_currency} markets = {k: v for k, v in markets.items() if v['base'] == base_currency}
if quote_currency: if quote_currency:

View File

@ -68,9 +68,6 @@ def start_list_pairs(args: Namespace, pairs_only: bool = False) -> None:
pairs_only=pairs_only, pairs_only=pairs_only,
active_only=args.active_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: if args.print_list:
# print data as a list # print data as a list
print(f"Exchange {exchange.name} has {len(pairs)} " + print(f"Exchange {exchange.name} has {len(pairs)} " +