Skip to content

Commit 8a796ba

Browse files
committed
Change typing from Path -> os.PathLike
1 parent 62cfc46 commit 8a796ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmdstanpy/utils/stancsv.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import io
66
import json
77
import math
8+
import os
89
import re
910
import warnings
10-
from pathlib import Path
1111
from typing import (
1212
Any,
1313
Dict,
@@ -28,7 +28,7 @@
2828

2929

3030
def parse_stan_csv_comments_and_draws(
31-
stan_csv: Union[str, Path, Iterator[bytes]],
31+
stan_csv: Union[str, os.PathLike, Iterator[bytes]],
3232
) -> Tuple[List[bytes], List[bytes]]:
3333
"""Parses lines of a Stan CSV file into comment lines and draws lines, where
3434
a draws line is just a non-commented line.
@@ -47,7 +47,7 @@ def split_comments_and_draws(
4747
draws_lines.append(line)
4848
return comment_lines, draws_lines
4949

50-
if isinstance(stan_csv, (str, Path)):
50+
if isinstance(stan_csv, (str, os.PathLike)):
5151
with open(stan_csv, "rb") as f:
5252
return split_comments_and_draws(f)
5353
else:

0 commit comments

Comments
 (0)