From 0111b528caef482904476b2a1c11d440366fd882 Mon Sep 17 00:00:00 2001 From: Chris Kuehl Date: Wed, 6 Jan 2016 18:07:00 -0800 Subject: [PATCH] Use os.access over os.stat for executeable check --- pre_commit/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_commit/git.py b/pre_commit/git.py index abddb026..15393ab4 100644 --- a/pre_commit/git.py +++ b/pre_commit/git.py @@ -102,7 +102,7 @@ def guess_git_type_for_file(path): return GIT_MODE_SYMLINK elif os.path.isfile(path): # determine if executable - if os.stat(path).st_mode & 0o111: + if os.access(path, os.X_OK): return GIT_MODE_EXECUTABLE else: return GIT_MODE_FILE