MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / remove_tree

Function remove_tree

emrun.py:1356–1367  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

1354
1355# Removes a directory tree even if it was readonly, and doesn't throw exception on failure.
1356def remove_tree(d):
1357 os.chmod(d, stat.S_IWRITE)
1358 try:
1359 def remove_readonly_and_try_again(func, path, exc_info):
1360 if not (os.stat(path).st_mode & stat.S_IWRITE):
1361 os.chmod(path, stat.S_IWRITE)
1362 func(path)
1363 else:
1364 raise exc_info[1]
1365 shutil.rmtree(d, onerror=remove_readonly_and_try_again)
1366 except Exception:
1367 pass
1368
1369
1370def get_system_info(format_json):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected