Skip to content

Commit

Permalink
Use plain assert rather than if-clause.
Browse files Browse the repository at this point in the history
Co-authored-by: Marcel Martin <[email protected]>
  • Loading branch information
rhpvorderman and marcelm authored Mar 19, 2024
1 parent 4647fd1 commit 4959714
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/xopen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,7 @@ def _detect_format_from_extension(filename: Union[str, bytes]) -> Optional[str]:
def _file_or_path_to_binary_stream(
file_or_path: FileOrPath, binary_mode: str
) -> Tuple[BinaryIO, bool]:
if binary_mode not in ("rb", "wb", "ab"):
raise AssertionError()
assert binary_mode in ("rb", "wb", "ab")
if file_or_path == "-":
return _open_stdin_or_out(binary_mode), False
if isinstance(file_or_path, (str, bytes)) or hasattr(file_or_path, "__fspath__"):
Expand Down

0 comments on commit 4959714

Please sign in to comment.