diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 9960b65..8fdf222 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -107,28 +107,32 @@ jobs: # - windows-latest # - windows-2016 python-version: - - 3.6 - - 3.7 - - 3.8 - - 3.9 + - "3.6" + - "3.7" + - "3.8" + - "3.9" + - "3.10" include: - os: ubuntu-latest - python-version: 3.6 + python-version: "3.6" tox_env: py36 - os: ubuntu-latest - python-version: 3.7 + python-version: "3.7" tox_env: py37 - os: ubuntu-latest - python-version: 3.8 + python-version: "3.8" tox_env: py38 - os: ubuntu-latest - python-version: 3.9 + python-version: "3.9" tox_env: py39 + - os: ubuntu-latest + python-version: "3.10" + tox_env: py310 - os: macOS-latest - python-version: 3.6 + python-version: "3.6" tox_env: py36 - os: macOS-latest - python-version: 3.9 + python-version: "3.10" tox_env: py39 env: diff --git a/setup.cfg b/setup.cfg index a35ca9e..1a3abae 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,6 +40,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Topic :: System :: Systems Administration Topic :: Utilities diff --git a/src/subprocess_tee/__init__.py b/src/subprocess_tee/__init__.py index 6e47f12..63e6786 100644 --- a/src/subprocess_tee/__init__.py +++ b/src/subprocess_tee/__init__.py @@ -80,7 +80,7 @@ def tee_func(line: bytes, sink: List[str], pipe: Optional[Any]) -> None: else: print(line_str) - loop = asyncio.get_event_loop() + loop = asyncio.get_event_loop_policy().get_event_loop() tasks = [] if process.stdout: tasks.append( @@ -135,7 +135,7 @@ def run(args: Union[str, List[str]], **kwargs: Any) -> CompletedProcess: if kwargs.get("echo", False): print(f"COMMAND: {cmd}") - loop = asyncio.get_event_loop() + loop = asyncio.get_event_loop_policy().get_event_loop() result = loop.run_until_complete(_stream_subprocess(cmd, **kwargs)) # we restore original args to mimic subproces.run() result.args = args