Add python3.5, pypy3, and latest git to travis

This commit is contained in:
Anthony Sottile 2015-12-04 13:35:24 -08:00
parent d24a9374d2
commit 2df1dc9023
7 changed files with 48 additions and 5 deletions

View file

@ -9,6 +9,7 @@ import stat
import sys
from pre_commit.logging_handler import LoggingHandler
from pre_commit.util import mkdirp
from pre_commit.util import resource_filename
@ -54,8 +55,7 @@ def install(runner, overwrite=False, hooks=False, hook_type='pre-commit'):
hook_path = runner.get_hook_path(hook_type)
legacy_path = hook_path + '.legacy'
if not os.path.exists(os.path.dirname(hook_path)):
os.makedirs(os.path.dirname(hook_path))
mkdirp(os.path.dirname(hook_path))
# If we have an existing hook, move it to pre-commit.legacy
if (

View file

@ -26,6 +26,14 @@ def cwd(path):
os.chdir(original_cwd)
def mkdirp(path):
try:
os.makedirs(path)
except OSError:
if not os.path.exists(path):
raise
def memoize_by_cwd(func):
"""Memoize a function call based on os.getcwd()."""
@functools.wraps(func)