Showing the changes to python/tests/utils.py (1 of 1 file). Show all
Unified · Split
| @@ -35,13 +35,9 @@ def del_tmp_sink_path(path): · 34 unmodified lines | |||
| 35 | try: | 35 | try: |
| 36 | os.unlink(path) | 36 | os.unlink(path) |
| 37 | except WindowsError as e: | 37 | except WindowsError as e: |
| 38 | print("deleting {:s} failed ({:s}), reopening".format(path, repr(e))) | 38 | # removing the temporary directory sometimes fails on windows |
| 39 | with open(path, 'wb') as f: | 39 | errmsg = "failed deleting temporary file {:s} ({:s})" |
| 40 | f.close() | 40 | warnings.warn(UserWarning(errmsg.format(path, repr(e)))) |
| 41 | try: | ||
| 42 | os.unlink(path) | ||
| 43 | except WindowsError as f: | ||
| 44 | print("deleting {:s} failed ({:s}), aborting".format(path, repr(e))) | ||
| 45 | 41 | ||
| 46 | def array_from_yaml_file(filename): | 42 | def array_from_yaml_file(filename): |
| 47 | import yaml | 43 | import yaml |