소스 검색

Updated exception reporter to new way of catching exceptions.

Sander Mathijs van Veen 14 년 전
부모
커밋
8eee727117
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/python/bison.py

+ 3 - 3
src/python/bison.py

@@ -470,7 +470,7 @@ class BisonParser(object):
                 raise ParserSyntaxError(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
 
             if not self.interactive:
@@ -480,9 +480,9 @@ class BisonParser(object):
         else:
             print error
             if not self.interactive:
-                raise error[3]
+                raise error.value
 
-            traceback.print_exception(*error[:2])
+            traceback.print_exception(*error.traceback_info)
 
     def toxml(self):
         """