Skip to content

avoid using exception.message, not necessarily available in python 3 #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cwltest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def compare_file(expected, actual):
compare(expected.get(k), actual.get(k))
except CompareFail as e:
raise CompareFail.format(expected, actual, u"field '%s' failed comparison: %s" %(
k, e.message
k, str(e)
))


Expand Down Expand Up @@ -218,7 +218,7 @@ def run_test(args, i, tests): # type: (argparse.Namespace, int, List[Dict[str,
_logger.error(t.get("doc"))
_logger.error("Returned non-zero")
_logger.error(outerr)
return TestResult(1, outstr, outerr, duration, err.message)
return TestResult(1, outstr, outerr, duration, str(err))
except (yamlscanner.ScannerError, TypeError) as e:
_logger.error(u"""Test failed: %s""", " ".join([pipes.quote(tc) for tc in test_command]))
_logger.error(outstr)
Expand All @@ -236,7 +236,7 @@ def run_test(args, i, tests): # type: (argparse.Namespace, int, List[Dict[str,
_logger.warn(u"""Test failed: %s""", " ".join([pipes.quote(tc) for tc in test_command]))
_logger.warn(t.get("doc"))
_logger.warn(u"Compare failure %s", ex)
fail_message = ex.message
fail_message = str(ex)

if outdir:
shutil.rmtree(outdir, True)
Expand Down