From cf725bee8c5b84faefc4b026c6b2c3172be5c481 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Sep 2025 06:06:17 +0530 Subject: [PATCH] handle missing follow_symlinks on windows --- setup/git_hooks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/git_hooks.py b/setup/git_hooks.py index 5724089cd8..cb82c1b875 100644 --- a/setup/git_hooks.py +++ b/setup/git_hooks.py @@ -104,7 +104,10 @@ class GitHooks(Command): os.remove(path) # remove if symlink with open(path, 'wb') as f: f.write(script.encode('utf-8')) - os.chmod(path, 0o744, follow_symlinks=False) + try: + os.chmod(path, 0o744, follow_symlinks=False) + except TypeError: + os.chmod(path, 0o744) def uninstall(self): self.info('Uninstalling the hooks:', ', '.join(self.names))