diff options
| author | 2021-12-21 12:31:55 -0800 | |
|---|---|---|
| committer | 2021-12-21 12:31:55 -0800 | |
| commit | 0d0ca5d6a07c79bcb4688b2a4850f3f2745d9be3 (patch) | |
| tree | b96e1e49dfd8b167d49d316675d5a5ed4437a4f0 | |
| parent | 37d492958691457006e25f4a2f9d33cf273256ad (diff) | |
Fix some python2/3 migration issues
Exception objects don't necessarily have a .message member, use str()
instead.
Test: th
Change-Id: I57b68dff1ace4937d6ef3b7c564f031e219491b1
| -rw-r--r-- | tools/releasetools/test_apex_utils.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/releasetools/test_apex_utils.py b/tools/releasetools/test_apex_utils.py index ed920f28d7..2aa6f6c58c 100644 --- a/tools/releasetools/test_apex_utils.py +++ b/tools/releasetools/test_apex_utils.py @@ -198,8 +198,9 @@ class ApexUtilsTest(test_utils.ReleaseToolsTestCase): # pass `false` as a sign_tool to see the invocation error with self.assertRaises(common.ExternalError) as cm: - signer = apex_utils.ApexApkSigner(apex_path, None, None, sign_tool='false') - signer.ProcessApexFile(apk_keys, self.payload_key) + signer = apex_utils.ApexApkSigner( + apex_path, None, None, sign_tool='false') + signer.ProcessApexFile(apk_keys, self.payload_key) the_exception = cm.exception - self.assertIn('Failed to run command \'[\'false\'', the_exception.message) + self.assertIn('Failed to run command \'[\'false\'', str(the_exception)) |