Skip to content
Snippets Groups Projects
Commit f1a06e80 authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Fix an erroneous errors message

This one was spotted by @fuzzy
parent 4f0e0685
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment