From f1a06e805b824cf366af43d51bec2b92b5cefdc8 Mon Sep 17 00:00:00 2001
From: jvoisin <julien.voisin@dustri.org>
Date: Wed, 8 May 2019 22:19:44 +0200
Subject: [PATCH] Fix an erroneous errors message

This one was spotted by @fuzzy
---
 mat2 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mat2 b/mat2
index e8d1883..f180d5c 100755
--- a/mat2
+++ b/mat2
@@ -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
 
-- 
GitLab