diff options
author | Cassidy Burden <cburden@google.com> | 2016-07-27 12:18:30 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-07-27 15:46:12 -0700 |
commit | 2711ac8d32ff2d03a16eeef65952e3c1a1e60fd0 (patch) | |
tree | d42d3131791018c5a96987c1789280d02737fda9 /binary_search_tool | |
parent | 1bb0c4dc6cb39b36db6e3c3f901b3fcc5525e950 (diff) | |
download | toolchain-utils-2711ac8d32ff2d03a16eeef65952e3c1a1e60fd0.tar.gz |
binary search tool: Alert user if --file_args required
Check for OS Error E2BIG when running switch script. If this happens
that means that --file_args is required.
TEST=Test with list of android objects, properly fails
Change-Id: If795ea5f45956ed0e5dd5eb6a9852f02d9f5978f
Reviewed-on: https://chrome-internal-review.googlesource.com/271688
Commit-Ready: Cassidy Burden <cburden@google.com>
Tested-by: Cassidy Burden <cburden@google.com>
Reviewed-by: Caroline Tice <cmtice@google.com>
Reviewed-by: Han Shen <shenhan@google.com>
Diffstat (limited to 'binary_search_tool')
-rwxr-xr-x | binary_search_tool/binary_search_state.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/binary_search_tool/binary_search_state.py b/binary_search_tool/binary_search_state.py index db8b3d06..62acd759 100755 --- a/binary_search_tool/binary_search_state.py +++ b/binary_search_tool/binary_search_state.py @@ -5,6 +5,7 @@ from __future__ import print_function import argparse import contextlib +import errno import math import os import pickle @@ -151,8 +152,14 @@ class BinarySearchState(object): command, print_to_console=self.verbose) else: command = '%s %s' % (switch_script, ' '.join(item_list)) - ret, _, _ = self.ce.RunCommandWExceptionCleanup( - command, print_to_console=self.verbose) + try: + ret, _, _ = self.ce.RunCommandWExceptionCleanup( + command, print_to_console=self.verbose) + except OSError as e: + if e.errno == errno.E2BIG: + raise Error('Too many arguments for switch script! Use --file_args') + else: + raise assert ret == 0, 'Switch script %s returned %d' % (switch_script, ret) def TestScript(self): |