From 15adec45d463aef85f13c657739a699e6c296caf Mon Sep 17 00:00:00 2001 From: Rene Lopez Date: Sat, 20 Feb 2010 13:23:10 -0600 Subject: [PATCH] Added support for Windows in ro_rmtree --- zeroinstall/support/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/zeroinstall/support/__init__.py b/zeroinstall/support/__init__.py index 6edf5ae..4baeafa 100644 --- a/zeroinstall/support/__init__.py +++ b/zeroinstall/support/__init__.py @@ -74,6 +74,13 @@ def ro_rmtree(root): @type root: str @since: 0.28""" import shutil - for main, dirs, files in os.walk(root): - os.chmod(main, 0700) + import platform + if platform.system() == 'Windows': + for main, dirs, files in os.walk(root): + for i in files + dirs: + os.chmod(os.path.join(main, i), 0700) + os.chmod(root, 0700) + else: + for main, dirs, files in os.walk(root): + os.chmod(main, 0700) shutil.rmtree(root) -- 2.11.4.GIT