From dd09470896e3e9caf89cbfd3ee0331d63b44a38f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:58:23 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- solara/components/markdown.py | 2 ++ solara/server/kernel_context.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/solara/components/markdown.py b/solara/components/markdown.py index cd35421ee..294e25bcc 100644 --- a/solara/components/markdown.py +++ b/solara/components/markdown.py @@ -9,6 +9,7 @@ import typing import ipyvuetify as v + try: import pymdownx.emoji import pymdownx.highlight @@ -276,6 +277,7 @@ def wrapper(*args, **kwargs): except Exception as e: logger.exception("Error while highlighting code") raise e + return wrapper diff --git a/solara/server/kernel_context.py b/solara/server/kernel_context.py index f53104448..fad4613e1 100644 --- a/solara/server/kernel_context.py +++ b/solara/server/kernel_context.py @@ -92,6 +92,7 @@ def restart(self): f() self._on_close_callbacks.clear() self.__post_init__() + lock: threading.RLock = dataclasses.field(default_factory=threading.RLock) def display(self, *args): @@ -230,6 +231,7 @@ async def create_task(): self._last_kernel_cull_task.cancel() logger.info("Scheduling kernel cull for virtual kernel %s", self.id) + async def create_task(): task = asyncio.create_task(kernel_cull()) # create a reference to the task so we can cancel it later