|
import os
|
|
import shutil
|
|
import time
|
|
|
|
def rmtree(path):
|
|
shutil.rmtree(path)
|
|
if not os.path.isdir(path): return
|
|
waited = 0
|
|
while waited < 100:
|
|
if not os.path.isdir(path): return
|
|
time.sleep(0.1)
|
|
waited += 1
|
|
raise Exception("Directory survived shutil.rmtree")
|