diff --git a/mce.py b/mce.py index ec09d99..918928b 100644 --- a/mce.py +++ b/mce.py @@ -122,15 +122,22 @@ class mce(object): else: break; - if blockType is None: - print "Ambiguous block specifier. Matches: ", matches; - raise ValueError - + else: - blockType = int(keyword); + try: + blockType = int(keyword); + except ValueError: + blockType = None; + + if blockType is None: + print "Ambiguous block specifier: ", keyword + if len(matches): + print "Matches: ", matches; + else: + print "No blocks matched." + raise ValueError - return blockType def _debug(self, command):