diff options
Diffstat (limited to 'platform_utils.py')
-rw-r--r-- | platform_utils.py | 9 |
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 | ||
244 | def rmtree(path): | 244 | def 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 | ||
254 | def handle_rmtree_error(function, path, excinfo): | 255 | def handle_rmtree_error(function, path, excinfo): |