]> git.madduck.net Git - etc/vim.git/commitdiff

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:

Hint at likely cause of ast parsing failure in error message (#2786)
authoremfdavid <84335963+emfdavid@users.noreply.github.com>
Thu, 20 Jan 2022 23:48:49 +0000 (18:48 -0500)
committerGitHub <noreply@github.com>
Thu, 20 Jan 2022 23:48:49 +0000 (15:48 -0800)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
src/black/__init__.py

index 67c272e3cc9a5e11ef7fe5419a08d0a413b3c9cd..bdece687e4517666e2fa7217a14f183b322edd44 100644 (file)
@@ -1312,7 +1312,10 @@ def assert_equivalent(src: str, dst: str, *, pass_num: int = 1) -> None:
         src_ast = parse_ast(src)
     except Exception as exc:
         raise AssertionError(
         src_ast = parse_ast(src)
     except Exception as exc:
         raise AssertionError(
-            f"cannot use --safe with this file; failed to parse source file: {exc}"
+            f"cannot use --safe with this file; failed to parse source file AST: "
+            f"{exc}\n"
+            f"This could be caused by running Black with an older Python version "
+            f"that does not support new syntax used in your source file."
         ) from exc
 
     try:
         ) from exc
 
     try: