Updated exception reporter to new way of catching exceptions.

parent 785dea0e
...@@ -470,7 +470,7 @@ class BisonParser(object): ...@@ -470,7 +470,7 @@ class BisonParser(object):
raise ParserSyntaxError(msg) raise ParserSyntaxError(msg)
print >>sys.stderr, msg print >>sys.stderr, msg
elif isinstance(error[0], int): elif hasattr(error, '__getitem__') and isinstance(error[0], int):
msg = 'Line %d: "%s" near "%s"' % error msg = 'Line %d: "%s" near "%s"' % error
if not self.interactive: if not self.interactive:
...@@ -480,9 +480,9 @@ class BisonParser(object): ...@@ -480,9 +480,9 @@ class BisonParser(object):
else: else:
print error print error
if not self.interactive: if not self.interactive:
raise error[3] raise error.value
traceback.print_exception(*error[:2]) traceback.print_exception(*error.traceback_info)
def toxml(self): def toxml(self):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment