Commit b970a264 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Print out exceptions when cleaning tests

parent faf86017
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import sys import sys
import os import os
import errno
import string import string
import re import re
import traceback import traceback
...@@ -463,12 +464,19 @@ def clean_full_paths(names): ...@@ -463,12 +464,19 @@ def clean_full_paths(names):
try: try:
# Remove files... # Remove files...
os.remove(name) os.remove(name)
except OSError: except OSError, e1:
try: try:
# ... and empty directories # ... and empty directories
os.rmdir(name) os.rmdir(name)
except OSError: except OSError, e2:
pass # We don't want to fail here, but we do want to know
# what went wrong, so print out the exceptions.
# ENOENT isn't a problem, though, as we clean files
# that don't necessarily exist.
if e1.errno != errno.ENOENT:
print e1
if e2.errno != errno.ENOENT:
print e2
def do_test(name, way, func, args): def do_test(name, way, func, args):
full_name = name + '(' + way + ')' 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