Skip to content

Commit

Permalink
Attempt to fix unit test again
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaughn Kottler authored and Vaughn Kottler committed Feb 16, 2023
1 parent c98be76 commit ff4d1ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtimepy/task/basic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from abc import ABC as _ABC
from abc import abstractmethod as _abstractmethod
import asyncio as _asyncio
from contextlib import suppress as _suppress
from logging import getLogger as _getLogger
from typing import Optional as _Optional

Expand Down Expand Up @@ -72,7 +73,8 @@ async def task(self, period_s: float) -> _asyncio.Task[None]:
if self._task is not None:
if not self._task.done():
self._task.cancel()
await self._task
with _suppress(_asyncio.CancelledError):
await self._task
_log_task_exception(self._task, logger=self.logger)

self._task = None
Expand Down

0 comments on commit ff4d1ab

Please sign in to comment.