Skip to content

Commit

Permalink
chore: prefer None check over string cast
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
  • Loading branch information
benmss committed Jan 5, 2024
1 parent 509fd9c commit 04ac019
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/macaron/repo_finder/commit_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def extract_commit_from_version(git_obj: Git, version: str) -> str | None:
if not commit:
return None

return str(commit.hash)
return commit.hash if commit else None


def find_commit_from_version_and_name(git_obj: Git, name: str, version: str) -> str | None:
Expand Down

0 comments on commit 04ac019

Please sign in to comment.