Skip to content

Commit 80fd8a0

Browse files
committed
kevm-pyk/utils: simplify write_cfg
1 parent 73fb317 commit 80fd8a0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kevm-pyk/src/kevm_pyk/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import json
21
import logging
32
from pathlib import Path
43
from typing import Callable, Collection, Final, Iterable, List, Optional, Tuple
@@ -16,9 +15,8 @@
1615

1716

1817
def write_cfg(_cfg: KCFG, _cfgpath: Path) -> None:
19-
with open(_cfgpath, 'w') as cfgfile:
20-
cfgfile.write(json.dumps(_cfg.to_dict()))
21-
_LOGGER.info(f'Updated CFG file: {_cfgpath}')
18+
_cfgpath.write_text(_cfg.to_json())
19+
_LOGGER.info(f'Updated CFG file: {_cfgpath}')
2220

2321

2422
def rpc_prove(

0 commit comments

Comments
 (0)