From de227330ea0c28d625ee110c7c2dc4214cd513bb Mon Sep 17 00:00:00 2001 From: Caner Derici Date: Fri, 19 Nov 2021 08:57:18 -0700 Subject: [PATCH] Fix for small bug in task handling Fixes #588 --- juju/jasyncio.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/juju/jasyncio.py b/juju/jasyncio.py index 8208065d6..d5826fbd2 100644 --- a/juju/jasyncio.py +++ b/juju/jasyncio.py @@ -24,6 +24,9 @@ import signal import functools import websockets +import logging + +ROOT_LOGGER = logging.getLogger() from asyncio import Event, TimeoutError, Queue, ensure_future, \ gather, sleep, wait_for, create_subprocess_exec, subprocess, \ @@ -46,7 +49,7 @@ def create_task(coro): return asyncio.ensure_future(coro) -def create_task_with_handler(coro, task_name, logger): +def create_task_with_handler(coro, task_name, logger=ROOT_LOGGER): """Wrapper around "asyncio.create_task" to make sure the task exceptions are handled properly.