diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 0e1b66f0db59..e86b73deafac 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -2,7 +2,6 @@ import re import sys -import warnings from collections.abc import Sequence from typing import Any, Callable, Final, Literal, Optional, TypeVar, Union, cast, overload @@ -227,11 +226,7 @@ def parse( assert options.python_version[0] >= 3 feature_version = options.python_version[1] try: - # Disable deprecation warnings about \u - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - ast = ast3_parse(source, fnam, "exec", feature_version=feature_version) - + ast = ast3_parse(source, fnam, "exec", feature_version=feature_version) tree = ASTConverter( options=options, is_stub=is_stub_file, diff --git a/mypy/test/testparse.py b/mypy/test/testparse.py index 027ca4dd2887..b7b26c689c5e 100644 --- a/mypy/test/testparse.py +++ b/mypy/test/testparse.py @@ -6,7 +6,6 @@ from pytest import skip -from mypy import defaults from mypy.config_parser import parse_mypy_comments from mypy.errors import CompileError, Errors from mypy.options import Options @@ -47,7 +46,7 @@ def test_parser(testcase: DataDrivenTestCase) -> None: elif testcase.file.endswith("python313.test"): options.python_version = (3, 13) else: - options.python_version = defaults.PYTHON3_VERSION + options.python_version = sys.version_info[:2] source = "\n".join(testcase.input)