Remove a file, noop if file does not exist.
(self, filename)
| 281 | return open(filename, mode) |
| 282 | |
| 283 | def remove_file(self, filename): |
| 284 | """Remove a file, noop if file does not exist.""" |
| 285 | # Unlike os.remove, if the file does not exist, |
| 286 | # then this method does nothing. |
| 287 | try: |
| 288 | os.remove(filename) |
| 289 | except OSError: |
| 290 | pass |
| 291 | |
| 292 | def rename_file(self, current_filename, new_filename): |
| 293 | rename_file(current_filename, new_filename) |