'clear distutils mkpath cache
prevents distutils from skipping re-creation of dirs that have been removed'

def _clear_distutils_mkpath_cache(self):

    try:
        from distutils.dir_util import _path_created
    except ImportError:
        pass
    else:
        _path_created.clear()
