소스 검색

Made BisonSyntaxError's arguments optional.

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

+ 4 - 3
src/python/bison.py

@@ -24,11 +24,12 @@ from bison_ import ParserEngine
 from .node import BisonNode
 
 class BisonSyntaxError(Exception):
-    def __init__(self, msg, args):
+    def __init__(self, msg, args=[]):
         super(BisonSyntaxError, self).__init__(msg)
 
-        self.first_line, self.first_col, self.last_line, self.last_col, \
-                self.message, self.token_value = args
+        if args:
+            self.first_line, self.first_col, self.last_line, self.last_col, \
+                    self.message, self.token_value = args
 
 class TimeoutError(Exception):
     pass