# HG changeset patch # User Patrick Mezard # Date 2008-01-05 21:52:28 # Node ID 4dfe7d5b1fc8b0df58aadab09d5844dcb10de589 # Parent a3a380af8fb5df38baf1c832bacf1b830e07efc9 # Parent 2f597243e1d7f67c9993c23800fb63f5658f44e7 Merge with crew-stable diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -68,6 +68,13 @@ if options.interactive and options.jobs print >> sys.stderr, 'ERROR: cannot mix -interactive and --jobs > 1' sys.exit(1) +def rename(src, dst): + """Like os.rename(), trade atomicity and opened files friendliness + for existing destination support. + """ + shutil.copy(src, dst) + os.remove(src) + def vlog(*msg): if verbose: for m in msg: @@ -530,7 +537,7 @@ def run_tests(tests): print "Accept this change? [n] ", answer = sys.stdin.readline().strip() if answer.lower() in "y yes".split(): - os.rename(test + ".err", test + ".out") + rename(test + ".err", test + ".out") tested += 1 continue failed += 1