OLD | NEW |
1 # Copyright 2013 The Swarming Authors. All rights reserved. | 1 # Copyright 2013 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed under the Apache License, Version 2.0 that | 2 # Use of this source code is governed by the Apache v2.0 license that can be |
3 # can be found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Provides functions: get_native_path_case(), isabs() and safe_join(). | 5 """Provides functions: get_native_path_case(), isabs() and safe_join(). |
6 | 6 |
7 This module assumes that filesystem is not changing while current process | 7 This module assumes that filesystem is not changing while current process |
8 is running and thus it caches results of functions that depend on FS state. | 8 is running and thus it caches results of functions that depend on FS state. |
9 """ | 9 """ |
10 | 10 |
11 import ctypes | 11 import ctypes |
12 import getpass | 12 import getpass |
13 import logging | 13 import logging |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 errors = [] | 971 errors = [] |
972 fs.rmtree(root, onerror=lambda *args: errors.append(args)) | 972 fs.rmtree(root, onerror=lambda *args: errors.append(args)) |
973 if errors: | 973 if errors: |
974 # There's no hope. | 974 # There's no hope. |
975 sys.stderr.write( | 975 sys.stderr.write( |
976 'Failed to delete %s. The following files remain:\n' % root) | 976 'Failed to delete %s. The following files remain:\n' % root) |
977 for _, path, _ in errors: | 977 for _, path, _ in errors: |
978 sys.stderr.write('- %s\n' % path) | 978 sys.stderr.write('- %s\n' % path) |
979 raise errors[0][2][0], errors[0][2][1], errors[0][2][2] | 979 raise errors[0][2][0], errors[0][2][1], errors[0][2][2] |
980 return False | 980 return False |
OLD | NEW |