Merge "Python 3: Don't use BaseException.message attribute"

This commit is contained in:
Jenkins 2016-07-19 17:33:33 +00:00 committed by Gerrit Code Review
commit 12cab0e30f
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ def deep_format(obj, paramdict, allow_empty=False):
else:
ret = CustomFormatter(allow_empty).format(obj, **paramdict)
except KeyError as exc:
missing_key = exc.message
missing_key = exc.args[0]
desc = "%s parameter missing to format %s\nGiven:\n%s" % (
missing_key, obj, pformat(paramdict))
raise JenkinsJobsException(desc)
@ -55,7 +55,7 @@ def deep_format(obj, paramdict, allow_empty=False):
ret[CustomFormatter(allow_empty).format(item, **paramdict)] = \
deep_format(obj[item], paramdict, allow_empty)
except KeyError as exc:
missing_key = exc.message
missing_key = exc.args[0]
desc = "%s parameter missing to format %s\nGiven:\n%s" % (
missing_key, obj, pformat(paramdict))
raise JenkinsJobsException(desc)