From 7d72e364aaa066e4e34387db4906611f39ea01c1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 12 Aug 2018 13:08:10 +0200 Subject: [PATCH] Remove broken ujson loading - replace with variable-based fix --- freqtrade/optimize/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/__init__.py b/freqtrade/optimize/__init__.py index 5c1bd06ab..a2259e19c 100644 --- a/freqtrade/optimize/__init__.py +++ b/freqtrade/optimize/__init__.py @@ -3,10 +3,11 @@ import gzip try: import ujson as json + _UJSON = True except ImportError: # see mypy/issues/1153 import json # type: ignore -import inspect + _UJSON = False import logging import os from typing import Optional, List, Dict, Tuple, Any @@ -21,7 +22,7 @@ logger = logging.getLogger(__name__) def json_load(data): """Try to load data with ujson""" - if inspect.getfullargspec(json.load)[5].get('precise_float'): + if _UJSON: return json.load(data, precise_float=True) else: return json.load(data)