def mock_makedirs(path, mode=int('0777', 8), exist_ok=True): if os.path.exists(path) and exist_ok: return None else: return real_makedirs(path.replace("\\", "/"), mode)