Laurent Bachelier  committed c084b8d

Fix hook file permissions

On my system (Python 2.7), I would end up with "--wxr-x--T".
This solution should work everywhere.

  • Participants
  • Parent commits 018872b
  • Branches default

Comments (0)

Files changed (1)

File flake8/

 from __future__ import with_statement
 import os
 import sys
+import stat
 from subprocess import Popen, PIPE
     # The 'demandimport' breaks pyflakes and flake8._pyflakes
     if 'git' in vcs:
         with open(vcs, 'w+') as fd:
-        # 0b111100100 == rwxr--r--
-        # Python 2.5 doesn't support 0b syntax so note that the above binary
-        # value is equivalent to 484 in decimal
-        os.chmod(vcs, 484)
+        # rwxr--r--
+        os.chmod(vcs, stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH)
     elif 'hg' in vcs: