Avoid "RuntimeError: Event loop is closed"
Triggered by pytest now. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
		@@ -95,8 +95,9 @@ def _atexit_handler():
 | 
			
		||||
    """
 | 
			
		||||
    loop = asyncio.get_event_loop()
 | 
			
		||||
    pending = asyncio.Task.all_tasks()
 | 
			
		||||
    loop.run_until_complete(asyncio.gather(*pending))
 | 
			
		||||
    loop.close()
 | 
			
		||||
    if not loop.is_closed():
 | 
			
		||||
        loop.run_until_complete(asyncio.gather(*pending))
 | 
			
		||||
        loop.close()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def kas_get_argparser():
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user