MCPcopy Index your code
hub / github.com/emscripten-core/emsdk / remove_tree

Function remove_tree

emsdk.py:291–304  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

289# Removes a directory tree even if it was readonly, and doesn't throw exception
290# on failure.
291def remove_tree(d):
292 debug_print(f'remove_tree({d})')
293 if not os.path.exists(d):
294 return
295 try:
296 def remove_readonly_and_try_again(func, path, exc_info):
297 if not (os.stat(path).st_mode & stat.S_IWRITE):
298 os.chmod(path, stat.S_IWRITE)
299 func(path)
300 else:
301 raise exc_info[1]
302 shutil.rmtree(d, onerror=remove_readonly_and_try_again)
303 except Exception as e:
304 debug_print('remove_tree threw an exception, ignoring: ' + str(e))
305
306
307def win_set_environment_variable_direct(key, value, system=True):

Callers 5

unzipFunction · 0.85
uninstall_binaryenFunction · 0.85
build_binaryen_toolFunction · 0.85
download_and_extractFunction · 0.85
uninstallMethod · 0.85

Calls 1

debug_printFunction · 0.85

Tested by

no test coverage detected