From: Paul Brossier Date: Thu, 1 Nov 2018 21:19:39 +0000 (+0100) Subject: [tests] do not try re-opening temporary file on windows, display a warning X-Git-Tag: 0.4.9~71^2~47 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=0ed0405c5bd95595da2ebd62cc9847c177f58aea;p=aubio.git [tests] do not try re-opening temporary file on windows, display a warning --- diff --git a/python/tests/utils.py b/python/tests/utils.py index b374fe5f..ee73e005 100644 --- a/python/tests/utils.py +++ b/python/tests/utils.py @@ -35,13 +35,9 @@ def del_tmp_sink_path(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))) + # 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