Use os.access over os.stat for executeable check

This commit is contained in:
Chris Kuehl 2016-01-06 18:07:00 -08:00 committed by Chris Kuehl
parent 32d28c3b08
commit 0111b528ca

View file

@ -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