MCPcopy Index your code
hub / github.com/RustPython/RustPython / _rmtree

Function _rmtree

Lib/test/support/os_helper.py:421–440  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

419 _waitfor(os.rmdir, dirname)
420
421 def _rmtree(path):
422 from test.support import _force_run
423
424 def _rmtree_inner(path):
425 for name in _force_run(path, os.listdir, path):
426 fullname = os.path.join(path, name)
427 try:
428 mode = os.lstat(fullname).st_mode
429 except OSError as exc:
430 print("support.rmtree(): os.lstat(%r) failed with %s"
431 % (fullname, exc),
432 file=sys.__stderr__)
433 mode = 0
434 if stat.S_ISDIR(mode):
435 _waitfor(_rmtree_inner, fullname, waitall=True)
436 _force_run(fullname, os.rmdir, fullname)
437 else:
438 _force_run(fullname, os.unlink, fullname)
439 _waitfor(_rmtree_inner, path, waitall=True)
440 _waitfor(lambda p: _force_run(p, os.rmdir, p), path)
441
442 def _longpath(path):
443 try:

Callers 1

rmtreeFunction · 0.85

Calls 4

_force_runFunction · 0.90
_waitforFunction · 0.85
_rmtree_innerFunction · 0.85
rmdirMethod · 0.80

Tested by

no test coverage detected