diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 6b2eb532003c..aa5c89cd0f41 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -232,9 +232,12 @@ def parse( assert options.python_version[0] >= 3 feature_version = options.python_version[1] try: - # Disable deprecation warnings about \u + # Disable + # - deprecation warnings about \u + # - syntax warnings for 'invalid escape sequence' (3.12+) and 'return in finally' (3.14+) with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=DeprecationWarning) + warnings.filterwarnings("ignore", category=SyntaxWarning) ast = ast3_parse(source, fnam, "exec", feature_version=feature_version) tree = ASTConverter( diff --git a/pyproject.toml b/pyproject.toml index adcca65bf015..96b05ba459b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -227,9 +227,6 @@ xfail_strict = true # Force warnings as errors filterwarnings = [ "error", - # Some testcases may contain code that emits SyntaxWarnings, and they are not yet - # handled consistently in 3.14 (PEP 765) - "default::SyntaxWarning", ] [tool.coverage.run]