1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 02:01:16 +00:00

utils/serializer: Fix exception handling in Python3

Allow for the fact that exceptions do not have a 'message' attribute in
Python3.
This commit is contained in:
Marc Bonnici 2018-07-04 11:19:50 +01:00 committed by setrofim
parent 57ddf7845c
commit 9d34fc0a4d

View File

@ -231,7 +231,7 @@ class yaml(object):
lineno = None
if hasattr(e, 'problem_mark'):
lineno = e.problem_mark.line # pylint: disable=no-member
raise SerializerSyntaxError(e.message, lineno)
raise SerializerSyntaxError(e.args[0] if e.args else str(e), lineno)
loads = load