From 8a2f48bf0c51421ff82b28919550432f83443b10 Mon Sep 17 00:00:00 2001 From: Philip DePetro Date: Tue, 9 Jun 2026 14:36:48 -0700 Subject: [PATCH] Fix invalid type annotation in test_pydev_monkey comprehension The list comprehension in test_monkey_patch_c_program_arg used an illegal annotated target (`for c: bytes in check`), which is not valid Python. Replace it with a plain target and clean up trailing whitespace in test_monkey_patch_args_c_with_bytes. --- .../_vendored/pydevd/tests_python/test_pydev_monkey.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debugpy/_vendored/pydevd/tests_python/test_pydev_monkey.py b/src/debugpy/_vendored/pydevd/tests_python/test_pydev_monkey.py index c2f0630f..55adac33 100644 --- a/src/debugpy/_vendored/pydevd/tests_python/test_pydev_monkey.py +++ b/src/debugpy/_vendored/pydevd/tests_python/test_pydev_monkey.py @@ -440,7 +440,7 @@ def test_monkey_patch_c_program_arg(use_bytes) -> None: encode = lambda s: s if use_bytes: - check: list[bytes] = [c.encode("utf-8") for c: bytes in check] + check: list[bytes] = [c.encode("utf-8") for c in check] encode = lambda s: s.encode("utf-8") assert pydev_monkey.patch_args(check) == [ @@ -502,10 +502,10 @@ def test_monkey_patch_args_c_with_bytes() -> None: b"-c", b'from joblib.externals.loky.backend import get_context; get_context().Manager()', ] - + # Should not raise TypeError about bytes/str mismatch. result = pydev_monkey.patch_args(check) - + # Result should be a list with bytes elements (since input was bytes) assert isinstance(result, list) assert all(isinstance(item, (bytes, str)) for item in result)