mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-14 08:24:46 +00:00
Fix hook file permissions
On my system (Python 2.7), I would end up with "--wxr-x--T". This solution should work everywhere.
This commit is contained in:
parent
d3b8f9a284
commit
d9fe125957
1 changed files with 3 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import stat
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
try:
|
try:
|
||||||
# The 'demandimport' breaks pyflakes and flake8._pyflakes
|
# The 'demandimport' breaks pyflakes and flake8._pyflakes
|
||||||
|
|
@ -172,10 +173,8 @@ def install_hook():
|
||||||
if 'git' in vcs:
|
if 'git' in vcs:
|
||||||
with open(vcs, 'w+') as fd:
|
with open(vcs, 'w+') as fd:
|
||||||
fd.write(git_hook_file)
|
fd.write(git_hook_file)
|
||||||
# 0b111100100 == rwxr--r--
|
# rwxr--r--
|
||||||
# Python 2.5 doesn't support 0b syntax so note that the above binary
|
os.chmod(vcs, stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH)
|
||||||
# value is equivalent to 484 in decimal
|
|
||||||
os.chmod(vcs, 484)
|
|
||||||
elif 'hg' in vcs:
|
elif 'hg' in vcs:
|
||||||
_install_hg_hook(vcs)
|
_install_hg_hook(vcs)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue