Skip to content

Commit 41567af

Browse files
authored
Merge pull request #30 from common-workflow-language/mmsg_attribute
avoid using exception.message, not necessarily available in python 3
2 parents 864a17b + 415ee46 commit 41567af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cwltest/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def compare_file(expected, actual):
8686
compare(expected.get(k), actual.get(k))
8787
except CompareFail as e:
8888
raise CompareFail.format(expected, actual, u"field '%s' failed comparison: %s" %(
89-
k, e.message
89+
k, str(e)
9090
))
9191

9292

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

241241
if outdir:
242242
shutil.rmtree(outdir, True)

0 commit comments

Comments
 (0)