diff options
author | Caroline Tice <cmtice@google.com> | 2016-07-22 16:28:12 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-07-27 07:23:18 -0700 |
commit | 9099a788cd7124024559c064e425ed9caef6e0ac (patch) | |
tree | 87df663ff83ab398121cd66e9528422979a63cf6 /fdo_scripts | |
parent | 19e119b46c14f57988ba3504369e815d3aab0122 (diff) | |
download | toolchain-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 'fdo_scripts')
-rwxr-xr-x | fdo_scripts/profile_cycler.py | 2 | ||||
-rw-r--r-- | fdo_scripts/summarize_hot_blocks.py | 4 | ||||
-rw-r--r-- | fdo_scripts/vanilla_vs_fdo.py | 14 |
3 files changed, 10 insertions, 10 deletions
diff --git a/fdo_scripts/profile_cycler.py b/fdo_scripts/profile_cycler.py index 738535f5..7715612f 100755 --- a/fdo_scripts/profile_cycler.py +++ b/fdo_scripts/profile_cycler.py @@ -43,7 +43,7 @@ class CyclerProfiler: 'chrome-src-internal', 'src', 'data', 'page_cycler') if not os.path.isdir(page_cycler_dir): - raise Exception('Page cycler dir %s not found!' % page_cycler_dir) + raise RuntimeError('Page cycler dir %s not found!' % page_cycler_dir) self._ce.CopyFiles(page_cycler_dir, os.path.join(self.REMOTE_TMP_DIR, 'page_cycler'), dest_machine=self._remote, diff --git a/fdo_scripts/summarize_hot_blocks.py b/fdo_scripts/summarize_hot_blocks.py index 6cf4164e..20c07fa4 100644 --- a/fdo_scripts/summarize_hot_blocks.py +++ b/fdo_scripts/summarize_hot_blocks.py @@ -74,7 +74,7 @@ class Collector(object): os.path.join(self._tempdir, list_file))) ret = self._ce.RunCommand(command) if ret: - raise Exception('Failed: %s' % command) + raise RuntimeError('Failed: %s' % command) def SummarizeLines(self, data_file): sum_lines = [] @@ -128,7 +128,7 @@ class Collector(object): ret = self._ce.RunCommand(merge_command) if ret: - raise Exception('Failed: %s' % merge_command) + raise RuntimeError('Failed: %s' % merge_command) print 'Generated general summary: ', summary_file def SummarizePreOptimized(self, summary_file): diff --git a/fdo_scripts/vanilla_vs_fdo.py b/fdo_scripts/vanilla_vs_fdo.py index 66e15ce2..6f42839d 100644 --- a/fdo_scripts/vanilla_vs_fdo.py +++ b/fdo_scripts/vanilla_vs_fdo.py @@ -30,10 +30,10 @@ class Patcher(object): full_args = '%s --dry-run' % args ret = self._RunPatchCommand(full_args) if ret: - raise Exception('Patch dry run failed!') + raise RuntimeError('Patch dry run failed!') ret = self._RunPatchCommand(args) if ret: - raise Exception('Patch application failed!') + raise RuntimeError('Patch application failed!') def __enter__(self): self._ApplyPatch('') @@ -75,11 +75,11 @@ class FDOComparator(object): command = misc.GetSetupBoardCommand(self._board, usepkg=True) ret = self._ce.ChrootRunCommand(self._chromeos_root, command) if ret: - raise Exception("Couldn't run setup_board!") + raise RuntimeError("Couldn't run setup_board!") command = misc.GetBuildPackagesCommand(self._board, True) ret = self._ce.ChrootRunCommand(self._chromeos_root, command) if ret: - raise Exception("Couldn't run build_packages!") + raise RuntimeError("Couldn't run build_packages!") def _ReportMismatches(self, build_log): mismatch_signature = '-Wcoverage-mismatch' @@ -123,7 +123,7 @@ class FDOComparator(object): self._ReportMismatches(out) if ret: - raise Exception("Couldn't build chrome browser!") + raise RuntimeError("Couldn't build chrome browser!") misc.LabelLatestImage(self._chromeos_root, self._board, label) return label @@ -160,7 +160,7 @@ class FDOComparator(object): command = '%s %s' % (crosperf, experiment_file) ret = self._ce.RunCommand(command) if ret: - raise Exception("Couldn't run crosperf!") + raise RuntimeError("Couldn't run crosperf!") def _ImageRemote(self, label): image_path = os.path.join( @@ -182,7 +182,7 @@ class FDOComparator(object): command = 'python %s %s' % (profile_cycler, ' '.join(profile_cycler_args)) ret = self._ce.RunCommand(command) if ret: - raise Exception("Couldn't profile cycler!") + raise RuntimeError("Couldn't profile cycler!") def _BuildGenerateImage(self): # TODO(asharif): add cflags as well. |