1
0
mirror of synced 2024-11-21 16:54:23 +01:00

Fix an erroneous errors message

This one was spotted by @fuzzy
This commit is contained in:
jvoisin 2019-05-08 22:19:44 +02:00
parent 4f0e0685ca
commit f1a06e805b

7
mat2
View File

@ -32,7 +32,12 @@ def __check_file(filename: str, mode: int = os.R_OK) -> bool:
print("[-] %s is not a regular file." % filename)
return False
elif not os.access(filename, mode):
print("[-] %s is not readable and writeable." % filename)
mode_str = [] # type: List[str]
if mode & os.R_OK:
mode_str += 'readable'
if mode & os.W_OK:
mode_str += 'writeable'
print("[-] %s is not %s." % (filename, 'nor '.join(mode_str)))
return False
return True