move away from Exception.message
Python 2.6 deprecated the Exception.message field and Python 3 has
dropped it entirely. Using str() on the exception should get us
all the same info, so switch to that (or implicitly so when using
%s with formatting output).
BUG=chromium:980619
TEST=`cros lint` is clean w/pylint-1.7 again
Change-Id: I5c4324ff0f2a81485e7a9091a50bf0c56a73c4f7
Reviewed-on: https://chromium-review.googlesource.com/1816122
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Will Bradley <wbbradley@chromium.org>
diff --git a/pre-upload.py b/pre-upload.py
index 9a19ac7..9a13272 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -991,7 +991,7 @@
license_types = licenses_lib.GetLicenseTypesFromEbuild(ebuild_content,
overlay_path)
except ValueError as e:
- return HookFailure(e.message, [ebuild])
+ return HookFailure(str(e), [ebuild])
# Also ignore licenses ending with '?'
for license_type in [x for x in license_types
@@ -1000,7 +1000,7 @@
licenses_lib.Licensing.FindLicenseType(license_type,
overlay_path=overlay_path)
except AssertionError as e:
- return HookFailure(e.message, [ebuild])
+ return HookFailure(str(e), [ebuild])
def _check_ebuild_virtual_pv(project, commit):