Skip to content

Commit

Permalink
Use Assignment Expression (Walrus) In Conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeebot committed Jan 1, 2024
1 parent ad69bf9 commit b2c9519
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions identify/identify.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ def tags_from_path(path: str) -> set[str]:

tags = {FILE}

executable = os.access(path, os.X_OK)
if executable:
if executable := os.access(path, os.X_OK):
tags.add(EXECUTABLE)
else:
tags.add(NON_EXECUTABLE)
Expand Down

0 comments on commit b2c9519

Please sign in to comment.