exec/cmd: expose [subprocess.]CompletedProcess for easy import in other modules
This commit is contained in:
parent
9e81fbf345
commit
0693792791
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ import os
|
||||||
import pwd
|
import pwd
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
from subprocess import CompletedProcess # make it easy for users of this module
|
||||||
from shlex import quote as shell_quote
|
from shlex import quote as shell_quote
|
||||||
from typing import Optional, Union, TypeAlias
|
from typing import Optional, Union, TypeAlias
|
||||||
|
|
||||||
|
@ -90,7 +91,7 @@ def run_cmd(
|
||||||
elevation_method: Optional[ElevationMethod] = None,
|
elevation_method: Optional[ElevationMethod] = None,
|
||||||
stdout: Optional[int] = None,
|
stdout: Optional[int] = None,
|
||||||
stderr=None,
|
stderr=None,
|
||||||
) -> Union[subprocess.CompletedProcess, int]:
|
) -> Union[CompletedProcess, int]:
|
||||||
"execute `script` as `switch_user`, elevating and su'ing as necessary"
|
"execute `script` as `switch_user`, elevating and su'ing as necessary"
|
||||||
kwargs: dict = {}
|
kwargs: dict = {}
|
||||||
env_cmd = []
|
env_cmd = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue