Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2812)

Unified Diff: bin/chromite

Issue 6461009: Fixed chromite shell to report python errors (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/chromite.git@master
Patch Set: Fixed nit and added comment Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/chromite
diff --git a/bin/chromite b/bin/chromite
index 48b09070c3b658c8867ce211d73e0bd987606234..db09bbe51accc5b2dc3ea0315e8f6edfa21e87a1 100755
--- a/bin/chromite
+++ b/bin/chromite
@@ -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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698