From 635a2a96be261e6f52ca298712318ed0f30f6567 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Tue, 7 Oct 2025 23:48:26 -0700 Subject: [PATCH 1/2] Update fastparse.py: clarify comment about deprecation warnings about \u This is the same as 'invalid escape sequence', just a different type of warning on lower Python versions. --- mypy/fastparse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index aa5c89cd0f41..df4270a42f1a 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -233,8 +233,8 @@ def parse( feature_version = options.python_version[1] try: # Disable - # - deprecation warnings about \u - # - syntax warnings for 'invalid escape sequence' (3.12+) and 'return in finally' (3.14+) + # - deprecation warnings for 'invalid escape sequence' (Python 3.11 and below) + # - 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) From 9fb5cc849c606024150ab18ab164a53404c952f7 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Tue, 7 Oct 2025 23:50:48 -0700 Subject: [PATCH 2/2] wait, I don't need a comma here --- mypy/fastparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index df4270a42f1a..276e183a6bf0 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -234,7 +234,7 @@ def parse( try: # Disable # - deprecation warnings for 'invalid escape sequence' (Python 3.11 and below) - # - syntax warnings for 'invalid escape sequence' (3.12+), and 'return in finally' (3.14+) + # - 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)