Commit 84eb4b25 authored by dianders@chromium.org's avatar dianders@chromium.org

Update to chromite wrapper to properly report import errors.

The recent changes to the chromite wrapper hid all import errors
in chromite, simply giving an error that chromite couldn't be found.
This fixes the problem.

For associated review in chromiumos git:
  http://codereview.chromium.org/6461009

Review URL: http://codereview.chromium.org/6487003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@74452 0039d316-1c4b-4281-b951-d872f2087c98
parent 1f312812
......@@ -55,6 +55,16 @@ for path in Search(os.getcwd()):
import chromite.shell.main
break
except ImportError, e:
# Just in case there is actually something wrong with Chromite, print
# a sensible error. We match only the end of the string so that we can
# handle an error within the chromite directory.
# The full error is 'No module named (chromite.)shell.main'
# Note: If you hit the directory containing chromite on the way up, then
# the error will be 'No module named shell.main' so we must check only the
# shell.main part.
if not str(e).endswith('shell.main'):
raise
# We've got different modules named chromite in the tree, pulling in the
# wrong one will break the right one. So unload it.
if 'chromite' in sys.modules:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment