From 9cd84aeea92bca433a73b2f8c88cd899163aec19 Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Thu, 25 Apr 2013 22:50:37 +0200 Subject: [PATCH] Fix for removing temp files on Windows --- run_tests.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/run_tests.py b/run_tests.py index 10531de9..270d2486 100755 --- a/run_tests.py +++ b/run_tests.py @@ -339,8 +339,9 @@ def run_test(testname): if not run_error: os.unlink(exe_name) if is_windows: - os.unlink("%s.pdb" % filename) - os.unlink("%s.ilk" % filename) + basename = os.path.basename(filename) + os.unlink("%s.pdb" % basename) + os.unlink("%s.ilk" % basename) os.unlink(obj_name) except: None @@ -367,8 +368,12 @@ def run_tasks_from_queue(queue, queue_ret, total_tests_arg, max_test_length_arg, if is_windows: try: os.remove("test_static.obj") - os.remove("/vc100.pdb") + # vc*.pdb trick is in anticipaton of new versions of VS. + vcpdb = glob.glob("vc*.pdb")[0] + os.remove(vcpdb) os.chdir("..") + # This will fail if there were failing tests or + # Windows is in bad mood. os.rmdir(tmpdir) except: None