projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44a3e5e
)
python/tests/utils.py: try reopening the file is deleting it fails on windows
author
Paul Brossier
<piem@piem.org>
Mon, 16 May 2016 04:09:38 +0000
(06:09 +0200)
committer
Paul Brossier
<piem@piem.org>
Mon, 16 May 2016 04:09:38 +0000
(06:09 +0200)
python/tests/utils.py
patch
|
blob
|
history
diff --git
a/python/tests/utils.py
b/python/tests/utils.py
index
4e4ac71
..
2e3c31e
100644
(file)
--- a/
python/tests/utils.py
+++ b/
python/tests/utils.py
@@
-29,7
+29,16
@@
def get_tmp_sink_path():
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