blib2to3 can raise TokenError and IndentationError too (#2671)
This commit is contained in:
parent
9424e795bf
commit
d9eee31ec8
@ -140,7 +140,7 @@ def matches_grammar(src_txt: str, grammar: Grammar) -> bool:
|
||||
drv = driver.Driver(grammar)
|
||||
try:
|
||||
drv.parse_string(src_txt, True)
|
||||
except ParseError:
|
||||
except (ParseError, TokenError, IndentationError):
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user