Changeset 3c4fb67 for python/tests


Ignore:
Timestamp:
May 16, 2016, 6:09:38 AM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
e0c74c2
Parents:
44a3e5e
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/utils.py

    r44a3e5e r3c4fb67  
    3030
    3131def del_tmp_sink_path(path):
    32     os.unlink(path)
     32    try:
     33        os.unlink(path)
     34    except WindowsError as e:
     35        print("deleting {:s} failed ({:s}), reopening".format(path, repr(e)))
     36        with open(path, 'wb') as f:
     37            f.close()
     38        try:
     39            os.unlink(path)
     40        except WindowsError as f:
     41            print("deleting {:s} failed ({:s}), aborting".format(path, repr(e)))
    3342
    3443def array_from_yaml_file(filename):
Note: See TracChangeset for help on using the changeset viewer.