From 274dd6c17b32b21803308c8f8d4926b74755582a Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Mon, 12 Oct 2015 22:59:12 -0700 Subject: [PATCH] Another error message cleanup --- kll.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kll.py b/kll.py index cae70f8..b03c67d 100755 --- a/kll.py +++ b/kll.py @@ -685,14 +685,14 @@ def processKLLFile( filename ): data = file.read() try: tokenSequence = tokenize( data ) - except LexerError as e: - print ( "{0} Tokenization error in '{1}' - {2}".format( ERROR, filename, e ) ) + except LexerError as err: + print ( "{0} Tokenization error in '{1}' - {2}".format( ERROR, filename, err ) ) sys.exit( 1 ) #print ( pformat( tokenSequence ) ) # Display tokenization try: tree = parse( tokenSequence ) - except NoParseError as e: - print ( "{0} Parsing error in '{1}' - {2}".format( ERROR, filename, e ) ) + except (NoParseError, KeyError) as err: + print ( "{0} Parsing error in '{1}' - {2}".format( ERROR, filename, err ) ) sys.exit( 1 )