Skip to content

Commit

Permalink
blib2to3 can raise TokenError and IndentationError too (#2671)
Browse files Browse the repository at this point in the history
  • Loading branch information
ichard26 committed Dec 5, 2021
1 parent 9424e79 commit d9eee31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/black/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9eee31

Please sign in to comment.