File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/toolbox-core/src/toolbox_core Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,9 @@ def load_tool(
108
108
depend on the tool itself.
109
109
"""
110
110
coro = self .__async_client .load_tool (name , auth_token_getters , bound_params )
111
- async_tool = asyncio .run_coroutine_threadsafe (coro , self .__loop ).result ()
111
+
112
+ # We have already created a new loop in the init method in case it does not already exist
113
+ async_tool = asyncio .run_coroutine_threadsafe (coro , self .__loop ).result () # type: ignore
112
114
113
115
if not self .__loop or not self .__thread :
114
116
raise ValueError ("Background loop or thread cannot be None." )
@@ -135,7 +137,9 @@ def load_toolset(
135
137
in the toolset.
136
138
"""
137
139
coro = self .__async_client .load_toolset (name , auth_token_getters , bound_params )
138
- async_tools = asyncio .run_coroutine_threadsafe (coro , self .__loop ).result ()
140
+
141
+ # We have already created a new loop in the init method in case it does not already exist
142
+ async_tools = asyncio .run_coroutine_threadsafe (coro , self .__loop ).result () # type: ignore
139
143
140
144
if not self .__loop or not self .__thread :
141
145
raise ValueError ("Background loop or thread cannot be None." )
You can’t perform that action at this time.
0 commit comments