]> git.donarmstrong.com Git - kiibohd-kll.git/commitdiff
Another error message cleanup
authorJacob Alexander <haata@kiibohd.com>
Tue, 13 Oct 2015 05:59:12 +0000 (22:59 -0700)
committerJacob Alexander <haata@kiibohd.com>
Tue, 13 Oct 2015 05:59:12 +0000 (22:59 -0700)
kll.py

diff --git a/kll.py b/kll.py
index cae70f8694ec139d94dc62cc11833a1e9fe104de..b03c67dd78bd0bcc8103b0f6bc7c90954f54bd4f 100755 (executable)
--- 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 )