Skip to content

Commit 93f78c6

Browse files
lp9052maartenbreddels
authored andcommitted
[Enhance]enhance_patch_thread_init_lp9052
new anyio sometime does not populate this filed properly now. With latest anyio(4.10.0) and using fastapi test client, this line will throw exception because kwarg['name'] is None
1 parent 520d4dc commit 93f78c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

solara/server/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def WidgetContextAwareThread__init__(self, *args, **kwargs):
280280
self.current_context = None
281281
# if we do this for the dummy threads, we got into a recursion
282282
# since threading.current_thread will call the _DummyThread constructor
283-
if not ("name" in kwargs and "Dummy-" in kwargs["name"]):
283+
if not ("name" in kwargs and kwargs["name"] is not None and "Dummy-" in kwargs["name"]):
284284
try:
285285
self.current_context = kernel_context.get_current_context()
286286
except RuntimeError:

0 commit comments

Comments
 (0)