]> git.madduck.net Git - etc/vim.git/blobdiff - src/black/parsing.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

blib2to3 can raise TokenError and IndentationError too (#2671)
[etc/vim.git] / src / black / parsing.py
index 2fd41f03ecd329ba4c7824e150cde2742935f381..c101643fe11f2e5473de5cc0a39f578804aa4397 100644 (file)
@@ -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