From 791daad1bde707790d5045f98e6d6f9286ba368c Mon Sep 17 00:00:00 2001 From: fumihiko kakuma Date: Fri, 8 Jul 2016 10:29:47 +0900 Subject: [PATCH] Python 3: Don't use BaseException.message attribute In Python 3, BaseException.message is removed. So we use args attribute instead. Change-Id: Ief654970cb29e88c21add1c3d4235b86ddc0b94e Related-Change-Id: I8f97c0b0452f348acef20e9d248f02b83cec2562 --- jenkins_jobs/formatter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins_jobs/formatter.py b/jenkins_jobs/formatter.py index 66724d274..224ad643f 100644 --- a/jenkins_jobs/formatter.py +++ b/jenkins_jobs/formatter.py @@ -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)