Skip to content

Commit

Permalink
Simplify run_command return type
Browse files Browse the repository at this point in the history
Changed the return type of run_command from CompletedProcess[str] to CompletedProcess. This was done to remove unnecessary type specificity and ensure compatibility with different Python versions. The update maintains functionality and improves code readability.
  • Loading branch information
coordt committed Aug 6, 2024
1 parent 500ecd3 commit b91224e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bumpversion/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def set_nested_value(d: dict, value: Any, path: str) -> None:
current_element = current_element[key]


def run_command(command: list, env: Optional[dict] = None) -> CompletedProcess[str]:
def run_command(command: list, env: Optional[dict] = None) -> CompletedProcess:
"""Run a shell command and return its output."""
result = subprocess.run(command, text=True, check=True, capture_output=True, env=env) # NOQA: S603

Check warning on line 108 in bumpversion/utils.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

bumpversion/utils.py#L108

subprocess call - check for execution of untrusted input.
result.check_returncode()
Expand Down

0 comments on commit b91224e

Please sign in to comment.