Skip to content

Commit 4bda01b

Browse files
committed
Fix data=None
1 parent c46880e commit 4bda01b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cmdstanpy/utils/filesystem.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ def _temp_single_json(
107107
data: Union[str, os.PathLike, Mapping[str, Any], None]
108108
) -> Iterator[Optional[str]]:
109109
"""Context manager for json files."""
110-
if data is None or isinstance(data, (str, os.PathLike)):
110+
if data is None:
111+
yield None
112+
return
113+
if isinstance(data, (str, os.PathLike)):
111114
yield str(data)
112115
return
113116

0 commit comments

Comments
 (0)