Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -29,7 +29,16 @@ def get_tmp_sink_path(): · 28 unmodified lines | ||
| 29 | 29 | return path |
| 30 | 30 | |
| 31 | 31 | def del_tmp_sink_path(path): |
| 32 | − os.unlink(path) | |
| 32 | + try: | |
| 33 | + os.unlink(path) | |
| 34 | + except WindowsError as e: | |
| 35 | + print("deleting {:s} failed ({:s}), reopening".format(path, repr(e))) | |
| 36 | + with open(path, 'wb') as f: | |
| 37 | + f.close() | |
| 38 | + try: | |
| 39 | + os.unlink(path) | |
| 40 | + except WindowsError as f: | |
| 41 | + print("deleting {:s} failed ({:s}), aborting".format(path, repr(e))) | |
| 33 | 42 | |
| 34 | 43 | def array_from_yaml_file(filename): |
| 35 | 44 | import yaml |