From a4884245013bb723d7594a6140a59f4754f36b44 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 22 Dec 2015 13:50:21 -0800 Subject: [PATCH] Use python3.5 in appveyor over py34 --- appveyor.yml | 11 +++++++---- pre_commit/util.py | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3506ea1b..be612d08 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,12 +1,11 @@ environment: matrix: - TOXENV: py27 - - TOXENV: py34 + - TOXENV: py35 install: - - "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%" - - pip install tox - - pip install virtualenv --upgrade + - "SET PATH=C:\\Python35;C:\\Python35\\Scripts;%PATH%" + - pip install tox virtualenv --upgrade - "mkdir -p C:\\Temp" - "SET TMPDIR=C:\\Temp" @@ -18,3 +17,7 @@ before_test: - git config --global user.email "user@example.com" test_script: tox + +cache: + - '%LOCALAPPDATA%\pip\cache' + - '%USERPROFILE%\.pre-commit' diff --git a/pre_commit/util.py b/pre_commit/util.py index 6fae7729..6a1ee62b 100644 --- a/pre_commit/util.py +++ b/pre_commit/util.py @@ -175,7 +175,10 @@ def rmtree(path): """On windows, rmtree fails for readonly dirs.""" def handle_remove_readonly(func, path, exc): # pragma: no cover (windows) excvalue = exc[1] - if func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES: + if ( + func in (os.rmdir, os.remove, os.unlink) and + excvalue.errno == errno.EACCES + ): os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) func(path) else: