diff --git a/parso/cache.py b/parso/cache.py index 86fde9a..30963bd 100644 --- a/parso/cache.py +++ b/parso/cache.py @@ -55,7 +55,7 @@ _VERSION_TAG = '%s-%s%s-%s' % ( """ Short name for distinguish Python implementations and versions. -It's like `sys.implementation.cache_tag` but for Python < 3.3 +It's like `sys.implementation.cache_tag` but for Python2 we generate something similar. See: http://docs.python.org/3/library/sys.html#sys.implementation """ diff --git a/parso/grammar.py b/parso/grammar.py index 41bbe20..c943a52 100644 --- a/parso/grammar.py +++ b/parso/grammar.py @@ -224,7 +224,7 @@ def load_grammar(**kwargs): Loads a :py:class:`parso.Grammar`. The default version is the current Python version. - :param str version: A python version string, e.g. ``version='3.3'``. + :param str version: A python version string, e.g. ``version='3.8'``. :param str path: A path to a grammar file """ def load_grammar(language='python', version=None, path=None): diff --git a/parso/utils.py b/parso/utils.py index d26c88e..5a49c32 100644 --- a/parso/utils.py +++ b/parso/utils.py @@ -123,7 +123,7 @@ def _parse_version(version): match = re.match(r'(\d+)(?:\.(\d)(?:\.\d+)?)?$', version) if match is None: raise ValueError('The given version is not in the right format. ' - 'Use something like "3.2" or "3".') + 'Use something like "3.8" or "3".') major = int(match.group(1)) minor = match.group(2) @@ -164,13 +164,13 @@ class PythonVersionInfo(namedtuple('Version', 'major, minor')): def parse_version_string(version=None): """ - Checks for a valid version number (e.g. `3.2` or `2.7.1` or `3`) and + Checks for a valid version number (e.g. `3.8` or `2.7.1` or `3`) and returns a corresponding version info that is always two characters long in decimal. """ if version is None: version = '%s.%s' % sys.version_info[:2] if not isinstance(version, (unicode, str)): - raise TypeError("version must be a string like 3.2.") + raise TypeError('version must be a string like "3.8"') return _parse_version(version) diff --git a/test/test_load_grammar.py b/test/test_load_grammar.py index 70dd807..30aacc9 100644 --- a/test/test_load_grammar.py +++ b/test/test_load_grammar.py @@ -28,4 +28,4 @@ def test_invalid_grammar_version(string): def test_grammar_int_version(): with pytest.raises(TypeError): - load_grammar(version=3.2) + load_grammar(version=3.8) diff --git a/test/test_parser_tree.py b/test/test_parser_tree.py index 883f7cb..3665f4e 100644 --- a/test/test_parser_tree.py +++ b/test/test_parser_tree.py @@ -142,7 +142,7 @@ def test_yields(each_version): def test_yield_from(): - y, = get_yield_exprs('def x(): (yield from 1)', '3.3') + y, = get_yield_exprs('def x(): (yield from 1)', '3.8') assert y.type == 'yield_expr' diff --git a/test/test_python_errors.py b/test/test_python_errors.py index f3a3d15..846cf0f 100644 --- a/test/test_python_errors.py +++ b/test/test_python_errors.py @@ -37,8 +37,7 @@ def test_python_exception_matches(code): error, = errors actual = error.message assert actual in wanted - # Somehow in Python3.3 the SyntaxError().lineno is sometimes None - assert line_nr is None or line_nr == error.start_pos[0] + assert line_nr == error.start_pos[0] def test_non_async_in_async():