Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Goscinski <[email protected]>
  • Loading branch information
GeigerJ2 and agoscinski authored Nov 4, 2024
1 parent d1a74cb commit 607e44d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/aiida/orm/nodes/data/code/installed.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ def validate_filepath_executable(self):
file_exists = transport.isfile(str(self.filepath_executable))
if file_exists:
mode = transport.get_mode(str(self.filepath_executable))
# Shift right to get the user permission bits
user_permissions = mode >> 6
# Check if the execute bit is set
user_has_execute = (user_permissions & 1) != 0
# check if execute but is set
user_has_execute = format(mode, "b")[6] == '1'

except Exception as exception:
raise exceptions.ValidationError(
Expand Down

0 comments on commit 607e44d

Please sign in to comment.