File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 1212 ```
1313"""
1414
15- from asyncio import get_event_loop , run
15+ from asyncio import new_event_loop , run , set_event_loop
1616from collections .abc import Callable , Coroutine
1717from json import JSONDecodeError , dumps , loads
1818from typing import Any , TypeVar , final
@@ -96,10 +96,17 @@ def launch(self) -> None:
9696
9797 # List platform and available manipulators.
9898 self ._console .info_print ("PLATFORM" , self ._platform_handler .get_display_name ())
99- self ._console .info_print (
100- "MANIPULATORS" ,
101- str (get_event_loop ().run_until_complete (self ._platform_handler .get_manipulators ()).manipulators ),
102- )
99+
100+ # Create event loop if one doesn't exist for getting manipulators
101+ loop = new_event_loop ()
102+ set_event_loop (loop )
103+ try :
104+ self ._console .info_print (
105+ "MANIPULATORS" ,
106+ str (loop .run_until_complete (self ._platform_handler .get_manipulators ()).manipulators ),
107+ )
108+ finally :
109+ loop .close ()
103110
104111 # Launch server
105112 if self ._options .use_proxy :
You can’t perform that action at this time.
0 commit comments