Create asyncio loop explicitly (#3804)

Creating the asyncio loop explicitly. This fixes the following
deprecation warning on Python 3.10:
/usr/src/supervisor/supervisor/__main__.py:31: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
This commit is contained in:
Stefan Agner 2022-08-19 16:01:01 +02:00 committed by GitHub
parent 8bca34ec6b
commit 5919bc2252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,8 @@ if __name__ == "__main__":
bootstrap.initialize_logging() bootstrap.initialize_logging()
# Init async event loop # Init async event loop
loop = asyncio.get_event_loop() loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
# Check if all information are available to setup Supervisor # Check if all information are available to setup Supervisor
bootstrap.check_environment() bootstrap.check_environment()