diff --git a/avocado/utils/path.py b/avocado/utils/path.py index 5c52c66cc5..2a7d55ccb5 100644 --- a/avocado/utils/path.py +++ b/avocado/utils/path.py @@ -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):