From 3a78d4c886ec0596719c07542df8e7ca144a1000 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Wed, 3 Jul 2019 13:24:28 +0300 Subject: [PATCH] move raising OperationalException to get_markets() --- freqtrade/exchange/exchange.py | 4 +++- freqtrade/utils.py | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 7f14b8043..f1689de8c 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -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: diff --git a/freqtrade/utils.py b/freqtrade/utils.py index 7779d3d7b..8e8b3717e 100644 --- a/freqtrade/utils.py +++ b/freqtrade/utils.py @@ -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)} " +