From de12823a1895ab87f3bd8865f2a3ef1cd8c79d09 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 25 Feb 2019 21:24:27 +0100 Subject: [PATCH] check-files.py: readability improvement in permission check --- tests/scripts/check-files.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/scripts/check-files.py b/tests/scripts/check-files.py index bc5b8f5bb..0bf01206e 100755 --- a/tests/scripts/check-files.py +++ b/tests/scripts/check-files.py @@ -91,8 +91,9 @@ class PermissionIssueTracker(FileIssueTracker): heading = "Incorrect permissions:" def check_file_for_issue(self, filepath): - if not (os.access(filepath, os.X_OK) == - filepath.endswith((".sh", ".pl", ".py"))): + is_executable = os.access(filepath, os.X_OK) + should_be_executable = filepath.endswith((".sh", ".pl", ".py")) + if is_executable != should_be_executable: self.files_with_issues[filepath] = None