From 172c879079eabfd64f3468c89f4e508c6578fa54 Mon Sep 17 00:00:00 2001 From: Ashwin Naren Date: Sun, 27 Apr 2025 16:58:19 -0700 Subject: [PATCH 1/3] callable __or__ patch --- Lib/_collections_abc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py index 601107d2d8..2ae0ef3d25 100644 --- a/Lib/_collections_abc.py +++ b/Lib/_collections_abc.py @@ -508,6 +508,10 @@ def __getitem__(self, item): new_args = (t_args, t_result) return _CallableGenericAlias(Callable, tuple(new_args)) + # TODO: RUSTPYTHON patch for common call + def __or__(self, other): + super().__or__(other) + def _is_param_expr(obj): """Checks if obj matches either a list of types, ``...``, ``ParamSpec`` or ``_ConcatenateGenericAlias`` from typing.py From 240dd98580c63d652ddf67ff870a3b444462650f Mon Sep 17 00:00:00 2001 From: Ashwin Naren Date: Wed, 30 Apr 2025 11:12:46 -0700 Subject: [PATCH 2/3] un-mark success --- Lib/test/test_subprocess.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 5a75971be6..7784e84eb3 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1773,8 +1773,6 @@ def test_run_with_pathlike_path_and_arguments(self): res = subprocess.run(args) self.assertEqual(res.returncode, 57) - # TODO: RUSTPYTHON - @unittest.expectedFailure @unittest.skipUnless(mswindows, "Maybe test trigger a leak on Ubuntu") def test_run_with_an_empty_env(self): # gh-105436: fix subprocess.run(..., env={}) broken on Windows From 60edff668be305cc226b437c700bd7e619642e07 Mon Sep 17 00:00:00 2001 From: Ashwin Naren Date: Wed, 30 Apr 2025 11:14:21 -0700 Subject: [PATCH 3/3] add test --- extra_tests/snippets/stdlib_typing.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 extra_tests/snippets/stdlib_typing.py diff --git a/extra_tests/snippets/stdlib_typing.py b/extra_tests/snippets/stdlib_typing.py new file mode 100644 index 0000000000..12ec4d55af --- /dev/null +++ b/extra_tests/snippets/stdlib_typing.py @@ -0,0 +1,9 @@ +from collections.abc import Awaitable, Callable +from typing import TypeVar + +T = TypeVar("T") + +def abort_signal_handler( + fn: Callable[[], Awaitable[T]], on_abort: Callable[[], None] | None = None +) -> T: + pass \ No newline at end of file