Windows native build fixes.

The testing of building on Windows is done using MSYS2.
This commit is contained in:
Chris Johns
2015-02-07 17:58:17 +11:00
parent 81ccf41bc0
commit d4eb08f55a
8 changed files with 37 additions and 16 deletions

View File

@@ -127,7 +127,14 @@ def mkdir(path):
def removeall(path):
def _onerror(function, path, excinfo):
print 'removeall error: (%s) %s' % (excinfo, path)
import stat
if not os.access(path, os.W_OK):
# Is the error an access error ?
os.chmod(path, stat.S_IWUSR)
function(path)
else:
print 'removeall error: %s' % (path)
raise
path = host(path)
shutil.rmtree(path, onerror = _onerror)