Implement atexit.rmtree

This commit is contained in:
Kovid Goyal
2025-01-05 11:04:23 +05:30
parent 0d5bcff353
commit 25cb73511f
2 changed files with 13 additions and 0 deletions

View File

@@ -44,6 +44,14 @@ raise SystemExit(p.wait())
p.stdin.flush()
select.select(readers, [], [], 10)
self.ae(read(), str(i+1))
sdir = os.path.join(self.tdir, 'd')
os.mkdir(sdir)
p.stdin.write(f'rmtree {sdir}\n'.encode())
p.stdin.flush()
open(os.path.join(sdir, 'f'), 'w').close()
select.select(readers, [], [], 10)
self.ae(read(), str(i+2))
self.assertTrue(os.listdir(self.tdir))
# Ensure child is ignoring signals