summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'iutil.py')
-rw-r--r--iutil.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/iutil.py b/iutil.py
index 042b94d1c..be7168ed1 100644
--- a/iutil.py
+++ b/iutil.py
@@ -290,14 +290,16 @@ def findtz(basepath, relpath):
def rmrf (path):
# this is only the very simple case.
+ # NOTE THAT THIS IS RACY IF USED ON AN INSTALLED SYSTEM
+ # IT IS ONLY SAFE FOR ANACONDA AS A CONTAINED ENVIRONMENT
if os.path.isdir(path):
files = os.listdir (path)
else:
os.unlink(path)
return
for file in files:
- if os.path.isdir(path + '/' + file):
- rmrf (path + '/' + file)
+ if (not os.path.islink(path + '/' + file) and
+ os.path.isdir(path + '/' + file)):
else:
os.unlink (path + '/' + file)
os.rmdir (path)