better handle bad block names

This commit is contained in:
David Vierra 2010-09-19 13:43:40 -10:00
parent 3993f041ea
commit 69c29a08a8

13
mce.py
View File

@ -122,14 +122,21 @@ class mce(object):
else: else:
break; break;
if blockType is None:
print "Ambiguous block specifier. Matches: ", matches;
raise ValueError
else: else:
try:
blockType = int(keyword); 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 return blockType