Fix #769946 (linux.py script crashes with an OS error 39 (directory not empty))

This commit is contained in:
Kovid Goyal 2011-04-24 11:06:49 -06:00
parent a65477fba2
commit a9e1969712

View File

@ -149,7 +149,8 @@ class PostInstall:
if islinux or isfreebsd:
for f in os.listdir('.'):
if os.stat(f).st_uid == 0:
os.rmdir(f) if os.path.isdir(f) else os.unlink(f)
import shutil
shutil.rmtree(f) if os.path.isdir(f) else os.unlink(f)
if os.stat(config_dir).st_uid == 0:
os.rmdir(config_dir)