Skip to content

Commit 15fe876

Browse files
committed
No else: raise at the end of function.
1 parent c47a5dc commit 15fe876

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/xopen/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,9 @@ def _file_or_path_to_binary_stream(
667667
if isinstance(file_or_path, io.IOBase) and not hasattr(file_or_path, "encoding"):
668668
# Text files have encoding attributes. This file is binary:
669669
return file_or_path, False
670-
else:
671-
raise TypeError(
672-
f"Unsupported type for {file_or_path}, "
673-
f"{file_or_path.__class__.__name__}."
674-
)
670+
raise TypeError(
671+
f"Unsupported type for {file_or_path}, " f"{file_or_path.__class__.__name__}."
672+
)
675673

676674

677675
def _filepath_from_path_or_filelike(fileorpath: FileOrPath) -> str:

0 commit comments

Comments
 (0)