Commit 18b711e0 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Catch exceptions while cleaning rather than checking for existence first

As well as being generally a good idea, os.access('foo') seems to return
true if foo.exe exists on Windows.
parent 0dd5ce3c
......@@ -304,8 +304,10 @@ def clean_o_hi():
def clean_full_paths(names):
if getTestOpts().cleanup != '':
for name in names:
if os.access(name, os.F_OK) :
try:
os.remove(name)
except OSError:
pass
def do_test(name, way, func, args):
full_name = name + '(' + way + ')'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment