X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/9424e795bf662743da6423b74e30ab74d1a93775..d9eee31ec81c42d9953aee0d7f0adaf211519a10:/src/black/parsing.py diff --git a/src/black/parsing.py b/src/black/parsing.py index 2fd41f0..c101643 100644 --- a/src/black/parsing.py +++ b/src/black/parsing.py @@ -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