File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -148,16 +148,12 @@ async def async_method_wrapper(*args: Any, **kwargs: Any) -> Any:
148
148
# Return a regular function wrapper
149
149
@streamline_tracebacks ()
150
150
def method_wrapper (* args : Any , ** kwargs : Any ) -> Any :
151
- loop = asyncio .get_event_loop ()
152
- if loop .is_running ():
153
- fut = asyncio .run_coroutine_threadsafe (get_response (args , kwargs ), loop )
154
- return fut .result ()
155
- else :
156
- return asyncio .run (get_response (args , kwargs ))
151
+ return asyncio .run (get_response (args , kwargs ))
157
152
158
153
return method_wrapper
159
154
else :
160
- return asyncio .run (get_response (tuple (), {}))
155
+ # For non-callable attributes, get them directly
156
+ return asyncio .run (get_response (tuple (), dict ()))
161
157
162
158
def close (self ):
163
159
# signal the response loop to exit
You can’t perform that action at this time.
0 commit comments