From 2679e328b2854d500f3e80a3e74651da29ceca3f Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Thu, 14 Dec 2023 08:54:47 -0600 Subject: [PATCH] exist_ok=True --- local-interchain/python/helpers/file_cache.py | 4 ++-- local-interchain/python/util_base.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/local-interchain/python/helpers/file_cache.py b/local-interchain/python/helpers/file_cache.py index 3b1457112..ee5be5f50 100644 --- a/local-interchain/python/helpers/file_cache.py +++ b/local-interchain/python/helpers/file_cache.py @@ -15,7 +15,7 @@ class Cache: @staticmethod def reset_contracts_cache_json(): if not os.path.exists(contracts_json_path): - os.makedirs(os.path.dirname(contracts_json_path)) + os.makedirs(os.path.dirname(contracts_json_path), exist_ok=True) with open(contracts_json_path, "w") as f: f.write(json.dumps({"start_time": 0, "file_cache": {}})) @@ -34,7 +34,7 @@ def get_chain_start_time_from_logs() -> int: def get_cache_or_default(contracts: dict, ictest_chain_start: int) -> dict: cache_time: str | int = 0 if os.path.exists(contracts_json_path): - os.makedirs(os.path.dirname(contracts_json_path)) + os.makedirs(os.path.dirname(contracts_json_path), exist_ok=True) with open(contracts_json_path, "r") as f: c = dict(json.load(f)) cache_time = c.get("start_time", 0) diff --git a/local-interchain/python/util_base.py b/local-interchain/python/util_base.py index 4ad8698d5..0567f1d44 100644 --- a/local-interchain/python/util_base.py +++ b/local-interchain/python/util_base.py @@ -12,7 +12,7 @@ # create contracts folder if not already if not os.path.exists(contracts_path): - os.makedirs(contracts_path) + os.makedirs(contracts_path, exist_ok=True) HOST = "127.0.0.1" PORT = 8080