diff --git a/vcsserver/hook_utils/__init__.py b/vcsserver/hook_utils/__init__.py --- a/vcsserver/hook_utils/__init__.py +++ b/vcsserver/hook_utils/__init__.py @@ -48,7 +48,7 @@ def install_git_hooks(repo_path, bare, e hooks_path = get_git_hooks_path(repo_path, bare) if not os.path.isdir(hooks_path): - os.makedirs(hooks_path, mode=0o777) + os.makedirs(hooks_path, mode=0o777, exist_ok=True) tmpl_post = pkg_resources.resource_string( 'vcsserver', '/'.join( @@ -100,7 +100,7 @@ def install_svn_hooks(repo_path, executa executable = executable or sys.executable hooks_path = get_svn_hooks_path(repo_path) if not os.path.isdir(hooks_path): - os.makedirs(hooks_path, mode=0o777) + os.makedirs(hooks_path, mode=0o777, exist_ok=True) tmpl_post = pkg_resources.resource_string( 'vcsserver', '/'.join( @@ -140,7 +140,7 @@ def install_svn_hooks(repo_path, executa def get_version_from_hook(hook_path): version = b'' hook_content = read_hook_content(hook_path) - matches = re.search(rb'(?:RC_HOOK_VER)\s*=\s*(.*)', hook_content) + matches = re.search(rb'RC_HOOK_VER\s*=\s*(.*)', hook_content) if matches: try: version = matches.groups()[0]