diff options
| author | jvoisin | 2019-05-08 22:19:44 +0200 |
|---|---|---|
| committer | jvoisin | 2019-05-08 22:34:32 +0200 |
| commit | f1a06e805b824cf366af43d51bec2b92b5cefdc8 (patch) | |
| tree | c49d799c569da927ad99731b1747c015847ef681 | |
| parent | 4f0e0685cab4eb5e123c1b59e738c72b42f8fa6c (diff) | |
Fix an erroneous errors message
This one was spotted by @fuzzy
| -rwxr-xr-x | mat2 | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -32,7 +32,12 @@ def __check_file(filename: str, mode: int = os.R_OK) -> bool: | |||
| 32 | print("[-] %s is not a regular file." % filename) | 32 | print("[-] %s is not a regular file." % filename) |
| 33 | return False | 33 | return False |
| 34 | elif not os.access(filename, mode): | 34 | elif not os.access(filename, mode): |
| 35 | print("[-] %s is not readable and writeable." % filename) | 35 | mode_str = [] # type: List[str] |
| 36 | if mode & os.R_OK: | ||
| 37 | mode_str += 'readable' | ||
| 38 | if mode & os.W_OK: | ||
| 39 | mode_str += 'writeable' | ||
| 40 | print("[-] %s is not %s." % (filename, 'nor '.join(mode_str))) | ||
| 36 | return False | 41 | return False |
| 37 | return True | 42 | return True |
| 38 | 43 | ||
