mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
Use os.access over os.stat for executeable check
This commit is contained in:
parent
32d28c3b08
commit
0111b528ca
1 changed files with 1 additions and 1 deletions
|
|
@ -102,7 +102,7 @@ def guess_git_type_for_file(path):
|
||||||
return GIT_MODE_SYMLINK
|
return GIT_MODE_SYMLINK
|
||||||
elif os.path.isfile(path):
|
elif os.path.isfile(path):
|
||||||
# determine if executable
|
# determine if executable
|
||||||
if os.stat(path).st_mode & 0o111:
|
if os.access(path, os.X_OK):
|
||||||
return GIT_MODE_EXECUTABLE
|
return GIT_MODE_EXECUTABLE
|
||||||
else:
|
else:
|
||||||
return GIT_MODE_FILE
|
return GIT_MODE_FILE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue