Skip to content

Commit 95ceb92

Browse files
authored
chore: address new Ruff PLC0207 lints (#1409)
1 parent f41e8b4 commit 95ceb92

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openapi_python_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _run_post_hooks(self) -> None:
126126
self._run_command(command)
127127

128128
def _run_command(self, cmd: str) -> None:
129-
cmd_name = cmd.split(" ")[0]
129+
cmd_name = cmd.split(" ", maxsplit=1)[0]
130130
command_exists = shutil.which(cmd_name)
131131
if not command_exists:
132132
self.errors.append(

openapi_python_client/parser/properties/schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def get_reference_simple_name(ref_path: str) -> str:
5050
"""
5151
Takes a path like `/components/schemas/NameOfThing` and returns a string like `NameOfThing`.
5252
"""
53-
return ref_path.split("/")[-1]
53+
return ref_path.rsplit("/", maxsplit=1)[-1]
5454

5555

5656
@define

0 commit comments

Comments
 (0)