X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/44d5da00b520a05cd56e58b3998660f64ea59ebd..575220f460fc3a5eeb05673e9cc7d8e80b6b7147:/src/black/parsing.py diff --git a/src/black/parsing.py b/src/black/parsing.py index 64c0b1e..762934b 100644 --- a/src/black/parsing.py +++ b/src/black/parsing.py @@ -27,8 +27,7 @@ _IS_PYPY = platform.python_implementation() == "PyPy" try: from typed_ast import ast3 except ImportError: - # Either our python version is too low, or we're on pypy - if sys.version_info < (3, 7) or (sys.version_info < (3, 8) and not _IS_PYPY): + if sys.version_info < (3, 8) and not _IS_PYPY: print( "The typed_ast package is required but not installed.\n" "You can upgrade to Python 3.8+ or install typed_ast with\n" @@ -166,8 +165,6 @@ def parse_single_version( # comments separately. return ast3.parse(src, filename, feature_version=version[1]) - raise AssertionError("INTERNAL ERROR: Tried parsing unsupported Python version!") - def parse_ast(src: str) -> Union[ast.AST, ast3.AST]: # TODO: support Python 4+ ;)