History

[tests] do not try re-opening temporary file on windows, display a warning

Paul Brossier committed 8 years ago

Commit 0ed04051 parent 0bae15a1 file · +3 −7Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/tests/utils.py+3−7
@@ -35,13 +35,9 @@ def del_tmp_sink_path(path): · 34 unmodified lines
3535 try:
3636 os.unlink(path)
3737 except WindowsError as e:
38− print("deleting {:s} failed ({:s}), reopening".format(path, repr(e)))
39− with open(path, 'wb') as f:
40− f.close()
41− try:
42− os.unlink(path)
43− except WindowsError as f:
44− print("deleting {:s} failed ({:s}), aborting".format(path, repr(e)))
38+ # removing the temporary directory sometimes fails on windows
39+ errmsg = "failed deleting temporary file {:s} ({:s})"
40+ warnings.warn(UserWarning(errmsg.format(path, repr(e))))
4541
4642 def array_from_yaml_file(filename):
4743 import yaml

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t