Fix exception catching on python 3

This commit sponsored by Paul Smith.  Thank you!
This commit is contained in:
Christopher Allan Webber 2014-09-16 15:08:28 -05:00
parent 13f37e75eb
commit 7893d43a8f

View File

@ -56,7 +56,7 @@ class TestMetadataFunctionality:
jsonld_fail_1 = None jsonld_fail_1 = None
try: try:
jsonld_fail_1 = compact_and_validate(metadata_fail_1) jsonld_fail_1 = compact_and_validate(metadata_fail_1)
except ValidationError, e: except ValidationError as e:
assert e.message == "'All Rights Reserved.' is not a 'uri'" assert e.message == "'All Rights Reserved.' is not a 'uri'"
assert jsonld_fail_1 == None assert jsonld_fail_1 == None
#,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,., #,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,
@ -72,7 +72,7 @@ class TestMetadataFunctionality:
jsonld_fail_2 = None jsonld_fail_2 = None
try: try:
jsonld_fail_2 = compact_and_validate(metadata_fail_2) jsonld_fail_2 = compact_and_validate(metadata_fail_2)
except ValidationError, e: except ValidationError as e:
assert e.message == "'The other day' is not a 'date-time'" assert e.message == "'The other day' is not a 'date-time'"
assert jsonld_fail_2 == None assert jsonld_fail_2 == None