summaryrefslogtreecommitdiffstats
path: root/pactest/pmrule.py
diff options
context:
space:
mode:
Diffstat (limited to 'pactest/pmrule.py')
-rwxr-xr-xpactest/pmrule.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pactest/pmrule.py b/pactest/pmrule.py
index ea3ad333..e7c9c44f 100755
--- a/pactest/pmrule.py
+++ b/pactest/pmrule.py
@@ -116,9 +116,12 @@ class pmrule:
if not f.ismodified():
success = 0
elif case == "MODE":
- mode = os.lstat(filename)[ST_MODE]
- if int(value,8) != S_IMODE(mode):
+ if not os.path.isfile(filename):
success = 0
+ else:
+ mode = os.lstat(filename)[ST_MODE]
+ if int(value,8) != S_IMODE(mode):
+ success = 0
elif case == "TYPE":
if value == "dir":
if not os.path.isdir(filename):