shutil, biraz akıllı olsa... :)

This commit is contained in:
Barış Metin
2005-07-05 20:48:45 +00:00
parent 03f6584dc2
commit 6b172f08a0
+2 -1
View File
@@ -151,7 +151,8 @@ def clean_dir(path):
# for name in dirs:
# os.rmdir(os.path.join(root, name))
# don't reimplement the wheel
shutil.rmtree(path)
if os.path.exists(path):
shutil.rmtree(path)
def dir_size(dir):
""" calculate the size of files under a dir