From 15898eec23485eb53141c49800eb864a37ee7154 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Sat, 8 Aug 2020 23:14:27 +0200 Subject: [PATCH] Allow Python files not to be executable .py files may be modules which are not standalone program, so allow them not to be executable. Signed-off-by: Gilles Peskine --- tests/scripts/check_files.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/scripts/check_files.py b/tests/scripts/check_files.py index 13fee9d762..c498117a97 100755 --- a/tests/scripts/check_files.py +++ b/tests/scripts/check_files.py @@ -161,9 +161,13 @@ class PermissionIssueTracker(FileIssueTracker): heading = "Incorrect permissions:" + # .py files can be either full scripts or modules, so they may or may + # not be executable. + suffix_exemptions = frozenset({".py"}) + def check_file_for_issue(self, filepath): is_executable = os.access(filepath, os.X_OK) - should_be_executable = filepath.endswith((".sh", ".pl", ".py")) + should_be_executable = filepath.endswith((".sh", ".pl")) if is_executable != should_be_executable: self.files_with_issues[filepath] = None