| 1300 | os.remove(path) |
| 1301 | |
| 1302 | def RemoveDirectory(self, abs_path): |
| 1303 | if self.platform == 'win32': |
| 1304 | # In other places in chromium, we often have to retry this command |
| 1305 | # because we're worried about other processes still holding on to |
| 1306 | # file handles, but when MB is invoked, it will be early enough in the |
| 1307 | # build that their should be no other processes to interfere. We |
| 1308 | # can change this if need be. |
| 1309 | self.Run(['cmd.exe', '/c', 'rmdir', '/q', '/s', abs_path]) |
| 1310 | else: |
| 1311 | shutil.rmtree(abs_path, ignore_errors=True) |
| 1312 | |
| 1313 | def TempFile(self, mode='w'): |
| 1314 | # This function largely exists so it can be overriden for testing. |