serialize: fix mypy error

This commit is contained in:
Peter Rowlands
2023-01-16 15:58:21 +09:00
committed by Peter Rowlands (변기호)
parent 977a1f9f43
commit c2e4f51479
+3 -1
View File
@@ -101,7 +101,9 @@ def _modify_data(
dumper: DumpersFn,
fs: Optional["FileSystem"] = None,
):
exists_fn = fs.exists if fs else os.path.exists
exists_fn = cast(
Callable[["StrPath"], bool], fs.exists if fs else os.path.exists
)
file_exists = exists_fn(cast(str, path))
data = _load_data(path, parser=parser, fs=fs) if file_exists else {}
yield data