aboutsummaryrefslogtreecommitdiff
path: root/test_gcc_dejagnu.py
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2016-07-22 16:28:12 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-27 07:23:18 -0700
commit9099a788cd7124024559c064e425ed9caef6e0ac (patch)
tree87df663ff83ab398121cd66e9528422979a63cf6 /test_gcc_dejagnu.py
parent19e119b46c14f57988ba3504369e815d3aab0122 (diff)
downloadtoolchain-utils-9099a788cd7124024559c064e425ed9caef6e0ac.tar.gz
[crosperf] Clean up exceptions.
Found all instances of 'raise Exception' and changed them to raise something slightly more specific. Changed a few 'except Exception' statements appropriately as well. BUG=chromium:566255 TEST=None Change-Id: If2666bd55838342bc71431e5e6ab2157c2c9e125 Reviewed-on: https://chrome-internal-review.googlesource.com/270731 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com>
Diffstat (limited to 'test_gcc_dejagnu.py')
-rwxr-xr-xtest_gcc_dejagnu.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test_gcc_dejagnu.py b/test_gcc_dejagnu.py
index 37640710..41304a03 100755
--- a/test_gcc_dejagnu.py
+++ b/test_gcc_dejagnu.py
@@ -45,12 +45,12 @@ class DejagnuAdapter(object):
'--minilayout', '--jobs=8']
ret = setup_chromeos.Main(cmd)
if ret:
- raise Exception('Failed to checkout chromeos')
+ raise RuntimeError('Failed to checkout chromeos')
## Do cros_sdk and setup_board, otherwise build_tc in next step will fail.
cmd = 'cd {0} && cros_sdk --download'.format(self._chromeos_root)
ret = self._cmd_exec.RunCommand(cmd, terminated_timeout=9000)
if ret:
- raise Exception('Failed to create chroot.')
+ raise RuntimeError('Failed to create chroot.')
def SetupBoard(self):
cmd = './setup_board --board=' + self._board
@@ -58,7 +58,7 @@ class DejagnuAdapter(object):
cmd,
terminated_timeout=4000)
if ret:
- raise Exception('Failed to setup board.')
+ raise RuntimeError('Failed to setup board.')
def CheckoutGCC(self):
cmd = 'git clone {0} {1} && cd {1} && git checkout {2}'.format(
@@ -66,7 +66,7 @@ class DejagnuAdapter(object):
ret = self._cmd_exec.RunCommand(cmd, terminated_timeout=300)
if ret:
- raise Exception('Failed to checkout gcc.')
+ raise RuntimeError('Failed to checkout gcc.')
## Handle build_tc bug.
cmd = ('touch {0}/gcc/config/arm/arm-tune.md ' + \
'{0}/gcc/config/arm/arm-tables.opt').format(self._gcc_dir)
@@ -78,7 +78,7 @@ class DejagnuAdapter(object):
'--gcc_dir=' + self._gcc_dir]
ret = build_tc.Main(build_gcc_args)
if ret:
- raise Exception('Building gcc failed.')
+ raise RuntimeError('Building gcc failed.')
def CheckGCC(self):
args = [run_dejagnu.__file__, '--board=' + self._board,
@@ -189,7 +189,7 @@ def ProcessArguments(argv):
options = parser.parse_args(argv[1:])
if not options.board or not options.remote:
- raise Exception('--board and --remote are mandatory options.')
+ raise SyntaxError('--board and --remote are mandatory options.')
return options