Skip to content

Commit

Permalink
Merge pull request #5986 from buildearth/master
Browse files Browse the repository at this point in the history
Add a determination of whether the path exists in os.stat
  • Loading branch information
richtja authored Jul 12, 2024
2 parents 438b38f + 92d6196 commit 8063f46
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions avocado/utils/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ def get_first_line(self):
return first_line

def has_exec_permission(self):
mode = os.stat(self.path)[stat.ST_MODE]
return mode & stat.S_IXUSR
if os.path.exists(self.path):
mode = os.stat(self.path)[stat.ST_MODE]
return mode & stat.S_IXUSR

def is_empty(self):
if os.path.exists(self.path):
Expand Down

0 comments on commit 8063f46

Please sign in to comment.