From d67e67d1662e0efd064333c8ab7d355051d619f1 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 15 Jul 2024 11:10:17 -0400 Subject: [PATCH] removed walrus from gasnow_file variable --- core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core.py b/core.py index 92b9770..462328f 100755 --- a/core.py +++ b/core.py @@ -379,8 +379,9 @@ def get_beacon_gas_prices(speed=None, cache_interval_seconds=10): speeds = ('rapid', 'fast', 'standard', 'slow',) os.makedirs(cache_folder := './data/cache/', exist_ok=True) gas = {} + gasnow_file = "{}/gasnow.json".format(cache_folder) try: - gas = json.load(open(gasnow_file := "{}/gasnow.json".format(cache_folder))) + gas = json.load(open(gasnow_file)) except (JSONDecodeError, FileNotFoundError): pass if not gas or not gas['data'] or (gas['data']['timestamp'] / 1000) + cache_interval_seconds < time.time():