common: Move call to ./_subprocess

master
Felix Stupp 10 months ago
parent 1de9c82d4a
commit ae8f8af954
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -1,8 +1,6 @@
from datetime import date, datetime
import subprocess
import sys
from typing import (
IO,
Literal,
Optional,
Sequence,
@ -11,21 +9,6 @@ from typing import (
)
def call(
args: Sequence[str],
check: bool = True,
stdin: Optional[IO] = None,
) -> subprocess.CompletedProcess:
proc = subprocess.run(
args,
capture_output=True,
check=check,
text=True,
stdin=stdin,
)
return proc
# source: https://peps.python.org/pep-0257/#handling-docstring-indentation
def trim(docstring: str) -> str:
"""

@ -4,10 +4,14 @@ from ._itertools import (
iter_lookahead,
limit_iter,
)
from ._subprocess import (
call,
)
__all__ = [
"all_same",
"call",
"fix_iter",
"iter_lookahead",
"limit_iter",

@ -0,0 +1,21 @@
import subprocess
from typing import (
IO,
Optional,
Sequence,
)
def call(
args: Sequence[str],
check: bool = True,
stdin: Optional[IO] = None,
) -> subprocess.CompletedProcess:
proc = subprocess.run(
args,
capture_output=True,
check=check,
text=True,
stdin=stdin,
)
return proc
Loading…
Cancel
Save