MCPcopy Index your code
hub / github.com/python/cpython / _rmtree

Function _rmtree

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

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…