Skip to content

Commit

Permalink
Enforce ruff/bugbear rule B034
Browse files Browse the repository at this point in the history
B034 `re.split` should pass `maxsplit` and `flags` as keyword arguments
     to avoid confusion due to unintuitive argument positions
  • Loading branch information
DimitriPapadopoulos committed May 24, 2024
1 parent f06fe01 commit bfd6e42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fsspec/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def isfilelike(f: Any) -> TypeGuard[IO[bytes]]:

def get_protocol(url: str) -> str:
url = stringify_path(url)
parts = re.split(r"(\:\:|\://)", url, 1)
parts = re.split(r"(\:\:|\://)", url, maxsplit=1)
if len(parts) > 1:
return parts[0]
return "file"
Expand Down

0 comments on commit bfd6e42

Please sign in to comment.