ref: 0ed0405c5bd95595da2ebd62cc9847c177f58aea
parent: 0bae15ac90f75f9da469356239bc59c928a60837
author: Paul Brossier <piem@piem.org>
date: Thu Nov 1 18:19:39 EDT 2018
[tests] do not try re-opening temporary file on windows, display a warning
--- a/python/tests/utils.py
+++ b/python/tests/utils.py
@@ -35,13 +35,9 @@
try:
os.unlink(path)
except WindowsError as e:
- print("deleting {:s} failed ({:s}), reopening".format(path, repr(e)))
- with open(path, 'wb') as f:
- f.close()
- try:
- os.unlink(path)
- except WindowsError as f:
- print("deleting {:s} failed ({:s}), aborting".format(path, repr(e)))
+ # removing the temporary directory sometimes fails on windows
+ errmsg = "failed deleting temporary file {:s} ({:s})"
+ warnings.warn(UserWarning(errmsg.format(path, repr(e))))
def array_from_yaml_file(filename):
import yaml