diff options
Diffstat (limited to 'pactest/pmrule.py')
-rwxr-xr-x | pactest/pmrule.py | 7 |
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): |