Skip to content

Commit 0cd6a73

Browse files
committed
internal/subprocess(refactor[typing]): Align pass_fds with typeshed
why: Use Collection[int] to match Python's official typeshed, allowing sets and frozensets which subprocess accepts at runtime. what: - Change pass_fds type from Sequence[int] to Collection[int] - Update both subprocess.py and run.py
1 parent abf071a commit 0cd6a73

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/libvcs/_internal/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import sys
2020
import time
2121
import typing as t
22-
from collections.abc import Iterable, Mapping, MutableMapping, Sequence
22+
from collections.abc import Collection, Iterable, Mapping, MutableMapping, Sequence
2323

2424
from libvcs import exc
2525
from libvcs._internal.types import StrOrBytesPath
@@ -139,7 +139,7 @@ def run(
139139
creationflags: int = 0,
140140
restore_signals: bool = True,
141141
start_new_session: bool = False,
142-
pass_fds: Sequence[int] = (),
142+
pass_fds: Collection[int] = (),
143143
*,
144144
encoding: str | None = None,
145145
errors: str | None = None,

src/libvcs/_internal/subprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import subprocess
4545
import sys
4646
import typing as t
47-
from collections.abc import Mapping, Sequence
47+
from collections.abc import Collection, Mapping, Sequence
4848

4949
from libvcs._internal.types import StrOrBytesPath
5050

@@ -108,7 +108,7 @@ class SubprocessCommand(SkipDefaultFieldsReprMixin):
108108
# POSIX-only
109109
restore_signals: bool = True
110110
start_new_session: bool = False
111-
pass_fds: Sequence[int] = ()
111+
pass_fds: Collection[int] = ()
112112
umask: int = -1
113113
pipesize: int = -1
114114
user: str | None = None

0 commit comments

Comments
 (0)