Skip to content

Commit 117088f

Browse files
committed
internal/subprocess(refactor[typing]): Align preexec_fn with typeshed
why: Use Callable[[], object] to match Python's official typeshed, accepting functions that return values (which subprocess ignores). what: - Change preexec_fn return type from None to object - Update both subprocess.py and run.py
1 parent 0cd6a73 commit 117088f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/libvcs/_internal/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def run(
130130
stdin: _FILE | None = None,
131131
stdout: _FILE | None = None,
132132
stderr: _FILE | None = None,
133-
preexec_fn: t.Callable[[], None] | None = None,
133+
preexec_fn: t.Callable[[], object] | None = None,
134134
close_fds: bool = True,
135135
shell: bool = False,
136136
cwd: StrOrBytesPath | None = None,

src/libvcs/_internal/subprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class SubprocessCommand(SkipDefaultFieldsReprMixin):
9595
stdin: _FILE = None
9696
stdout: _FILE = None
9797
stderr: _FILE = None
98-
preexec_fn: t.Callable[[], None] | None = None
98+
preexec_fn: t.Callable[[], object] | None = None
9999
close_fds: bool = True
100100
shell: bool = False
101101
cwd: StrOrBytesPath | None = None

0 commit comments

Comments
 (0)