diff options
author | Maxim Devaev <[email protected]> | 2022-09-04 18:08:40 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-09-04 18:08:40 +0300 |
commit | ee3e224e396494cd0d69bb6167087a071a20349c (patch) | |
tree | 5becd28570e58a03c6e1e231d0db24c264a73f88 /kvmd/aioproc.py | |
parent | 4b75221e9470b4a009955d7677f16adf8e23e302 (diff) |
new typing style
Diffstat (limited to 'kvmd/aioproc.py')
-rw-r--r-- | kvmd/aioproc.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/kvmd/aioproc.py b/kvmd/aioproc.py index 5df2aaf2..a06628c5 100644 --- a/kvmd/aioproc.py +++ b/kvmd/aioproc.py @@ -26,11 +26,6 @@ import asyncio import asyncio.subprocess import logging -from typing import Tuple -from typing import List -from typing import Dict -from typing import Optional - import setproctitle from .logging import get_logger @@ -38,9 +33,9 @@ from .logging import get_logger # ===== async def run_process( - cmd: List[str], + cmd: list[str], err_to_null: bool=False, - env: Optional[Dict[str, str]]=None, + env: (dict[str, str] | None)=None, ) -> asyncio.subprocess.Process: # pylint: disable=no-member return (await asyncio.create_subprocess_exec( @@ -53,10 +48,10 @@ async def run_process( async def read_process( - cmd: List[str], + cmd: list[str], err_to_null: bool=False, - env: Optional[Dict[str, str]]=None, -) -> Tuple[asyncio.subprocess.Process, str]: # pylint: disable=no-member + env: (dict[str, str] | None)=None, +) -> tuple[asyncio.subprocess.Process, str]: # pylint: disable=no-member proc = await run_process(cmd, err_to_null, env) (stdout, _) = await proc.communicate() @@ -64,9 +59,9 @@ async def read_process( async def log_process( - cmd: List[str], + cmd: list[str], logger: logging.Logger, - env: Optional[Dict[str, str]]=None, + env: (dict[str, str] | None)=None, prefix: str="", ) -> asyncio.subprocess.Process: # pylint: disable=no-member |