From cbfd1c491afa2f0d4740e82e8525baa91b4cb4d0 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 25 Mar 2022 09:41:58 -0300 Subject: [PATCH] [commons.system] refactoring: 'new_subprocess' parameters tyiping --- bauh/commons/system.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bauh/commons/system.py b/bauh/commons/system.py index 5a47f994..6be7f1eb 100644 --- a/bauh/commons/system.py +++ b/bauh/commons/system.py @@ -4,7 +4,7 @@ import sys import time from io import StringIO from subprocess import PIPE -from typing import List, Tuple, Set, Dict, Optional, Iterable +from typing import List, Tuple, Set, Dict, Optional, Iterable, Union, IO, Any # default environment variables for subprocesses. from bauh.api.abstract.handler import ProcessWatcher @@ -266,7 +266,7 @@ def run_cmd(cmd: str, expected_code: int = 0, ignore_return_code: bool = False, pass -def new_subprocess(cmd: List[str], cwd: str = '.', shell: bool = False, stdin = None, +def new_subprocess(cmd: Iterable[str], cwd: str = '.', shell: bool = False, stdin: Optional[Union[None, int, IO[Any]]] = None, global_interpreter: bool = USE_GLOBAL_INTERPRETER, lang: Optional[str] = DEFAULT_LANG, extra_paths: Set[str] = None, custom_user: Optional[str] = None) -> subprocess.Popen: args = {