From 069379279138119e9c29fa98d575acb3e02ce3ca Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Fri, 9 Dec 2022 05:32:31 +0100 Subject: [PATCH] exec/cmd: expose [subprocess.]CompletedProcess for easy import in other modules --- exec/cmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exec/cmd.py b/exec/cmd.py index 22250a2..378528f 100644 --- a/exec/cmd.py +++ b/exec/cmd.py @@ -3,6 +3,7 @@ import os import pwd import subprocess +from subprocess import CompletedProcess # make it easy for users of this module from shlex import quote as shell_quote from typing import Optional, Union, TypeAlias @@ -90,7 +91,7 @@ def run_cmd( elevation_method: Optional[ElevationMethod] = None, stdout: Optional[int] = None, stderr=None, -) -> Union[subprocess.CompletedProcess, int]: +) -> Union[CompletedProcess, int]: "execute `script` as `switch_user`, elevating and su'ing as necessary" kwargs: dict = {} env_cmd = []