summaryrefslogtreecommitdiffstats
path: root/platform_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'platform_utils.py')
-rw-r--r--platform_utils.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/platform_utils.py b/platform_utils.py
index 77e8fdf5..6684ebc8 100644
--- a/platform_utils.py
+++ b/platform_utils.py
@@ -241,14 +241,15 @@ def _makelongpath(path):
241 return path 241 return path
242 242
243 243
244def rmtree(path): 244def rmtree(path, ignore_errors=False):
245 """shutil.rmtree(path) wrapper with support for long paths on Windows. 245 """shutil.rmtree(path) wrapper with support for long paths on Windows.
246 246
247 Availability: Unix, Windows.""" 247 Availability: Unix, Windows."""
248 onerror = None
248 if isWindows(): 249 if isWindows():
249 shutil.rmtree(_makelongpath(path), onerror=handle_rmtree_error) 250 path = _makelongpath(path)
250 else: 251 onerror = handle_rmtree_error
251 shutil.rmtree(path) 252 shutil.rmtree(path, ignore_errors=ignore_errors, onerror=onerror)
252 253
253 254
254def handle_rmtree_error(function, path, excinfo): 255def handle_rmtree_error(function, path, excinfo):