Skip to content

Commit

Permalink
Fix data=None
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Aug 28, 2023
1 parent c46880e commit 4bda01b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmdstanpy/utils/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def _temp_single_json(
data: Union[str, os.PathLike, Mapping[str, Any], None]
) -> Iterator[Optional[str]]:
"""Context manager for json files."""
if data is None or isinstance(data, (str, os.PathLike)):
if data is None:
yield None
return
if isinstance(data, (str, os.PathLike)):
yield str(data)
return

Expand Down

0 comments on commit 4bda01b

Please sign in to comment.