Permalink
Browse files

catching TokenErrors

  • Loading branch information...
1 parent 4bec9df commit fd17797cded4652eb93cbe370f45d1bfe838760d @jaredly committed Jul 29, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 codetalker/testing.py
View
4 codetalker/testing.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-from codetalker.pgm.errors import ParseError
+from codetalker.pgm.errors import ParseError, TokenError
def parse_rule(name, grammar):
parts = name.split('.')
@@ -14,7 +14,7 @@ def _fail(string):
def meta():
try:
res = grammar.get_parse_tree(string, start=rule)
- except ParseError, e:
+ except (ParseError, TokenError), e:
pass
else:
raise AssertionError('parsing was supposed to fail for', string, res)

0 comments on commit fd17797

Please sign in to comment.