Skip to content

Commit

Permalink
removed asyncio 3.6 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfischer2781 committed Jul 26, 2023
1 parent e78096e commit 197dc1b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 55 deletions.
51 changes: 0 additions & 51 deletions src/cobald/daemon/runners/_compat.py

This file was deleted.

3 changes: 1 addition & 2 deletions src/cobald/daemon/runners/asyncio_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import asyncio

from .base_runner import BaseRunner, OrphanedReturn
from ._compat import asyncio_current_task


class AsyncioRunner(BaseRunner):
Expand Down Expand Up @@ -46,7 +45,7 @@ async def _monitor_payload(self, payload: Callable[[], Awaitable]):
if result is None:
return
failure = OrphanedReturn(payload, result)
self._tasks.discard(asyncio_current_task())
self._tasks.discard(asyncio.current_task())
if not self._payload_failure.done():
self._payload_failure.set_exception(failure)

Expand Down
3 changes: 1 addition & 2 deletions src/cobald/daemon/runners/meta_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .trio_runner import TrioRunner
from .asyncio_runner import AsyncioRunner
from .thread_runner import ThreadRunner
from ._compat import asyncio_run

from ..debug import NameRepr

Expand Down Expand Up @@ -67,7 +66,7 @@ def run(self):
"""Run all runners, blocking until completion or error"""
self._logger.info("starting all runners")
try:
asyncio_run(self._manage_runners())
asyncio.run(self._manage_runners())
except KeyboardInterrupt:
self._logger.info("runner interrupted")
except Exception as err:
Expand Down

0 comments on commit 197dc1b

Please sign in to comment.