Fix boost fetching

This commit is contained in:
Oleg Korshul
2020-03-12 14:36:42 +03:00
parent 8141f9d3e7
commit 3c341975f5
3 changed files with 21 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import sys
import config
import codecs
import re
import stat
# common functions --------------------------------------
def get_script_dir(file=""):
@ -131,6 +132,18 @@ def copy_dir(src, dst):
print('Directory not copied. Error: %s' % e)
return
def delete_dir_with_access_error(path):
def delete_file_on_error(func, path, exc_info):
if not os.access(path, os.W_OK):
os.chmod(path, stat.S_IWUSR)
func(path)
return
if not is_dir(path):
print("delete warning [folder not exist]: " + path)
return
shutil.rmtree(get_path(path), ignore_errors=False, onerror=delete_file_on_error)
return
def delete_dir(path):
if not is_dir(path):
print("delete warning [folder not exist]: " + path)