shithub: aubio

Download patch

ref: 3c4fb67a2de8471c1e63edfff8d69451f0296f76
parent: 44a3e5e3add5c818a009b8f3bd1f975b9b1d0d84
author: Paul Brossier <piem@piem.org>
date: Mon May 16 02:09:38 EDT 2016

python/tests/utils.py: try reopening the file is deleting it fails on windows

--- a/python/tests/utils.py
+++ b/python/tests/utils.py
@@ -29,7 +29,16 @@
     return path
 
 def del_tmp_sink_path(path):
-    os.unlink(path)
+    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)))
 
 def array_from_yaml_file(filename):
     import yaml