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