Skip to content

Commit f61ecf2

Browse files
committed
Make filepath function private
1 parent 576e3dd commit f61ecf2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/xopen/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def __init__( # noqa: C901
199199
f"compresslevel must be in {program_settings.acceptable_compression_levels}."
200200
)
201201
self.fileobj, self.closefd = _file_or_path_to_binary_stream(filename, mode)
202-
filepath = filepath_from_path_or_filelike(filename)
202+
filepath = _filepath_from_path_or_filelike(filename)
203203
self.name: str = str(filepath)
204204
self._mode: str = mode
205205
self._stderr = tempfile.TemporaryFile("w+b")
@@ -685,7 +685,7 @@ def _file_or_path_to_binary_stream(
685685
)
686686

687687

688-
def filepath_from_path_or_filelike(fileorpath: FileOrPath):
688+
def _filepath_from_path_or_filelike(fileorpath: FileOrPath):
689689
try:
690690
return os.fspath(fileorpath) # type: ignore
691691
except TypeError:
@@ -785,7 +785,7 @@ def xopen( # noqa: C901 # The function is complex, but readable.
785785
if mode not in ("rt", "rb", "wt", "wb", "at", "ab"):
786786
raise ValueError("Mode '{}' not supported".format(mode))
787787
binary_mode = mode[0] + "b"
788-
filepath = filepath_from_path_or_filelike(filename)
788+
filepath = _filepath_from_path_or_filelike(filename)
789789

790790
if format not in (None, "gz", "xz", "bz2", "zst"):
791791
raise ValueError(

0 commit comments

Comments
 (0)