Describe the bug
In Python 3.10 you'll get a DeprecationWarning If you run the server example
To Reproduce
Run example code from documentation main page: https://docs.aiohttp.org/en/stable/index.html#server-example
from aiohttp import web
async def handle(request):
name = request.match_info.get('name', "Anonymous")
text = "Hello, " + name
return web.Response(text=text)
app = web.Application()
app.add_routes([web.get('/', handle),
web.get('/{name}', handle)])
if __name__ == '__main__':
web.run_app(app) # <------- calls asyncio.get_event_loop() with no running loop
Expected behavior
No DeprecationWarning, example modified to show the proper way to run it under Python 3.10
Logs/tracebacks
/venv3/lib/site-packages/aiohttp/web.py:479: DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop()
======== Running on http://0.0.0.0:8080 ========
Python Version
aiohttp Version
multidict Version
yarl Version
OS
Windows 10
Related component
Server
Additional context
No response
Code of Conduct
Describe the bug
In Python 3.10 you'll get a DeprecationWarning If you run the server example
To Reproduce
Run example code from documentation main page: https://docs.aiohttp.org/en/stable/index.html#server-example
Expected behavior
No DeprecationWarning, example modified to show the proper way to run it under Python 3.10
Logs/tracebacks
Python Version
Python 3.10.4aiohttp Version
aiohttp 3.7.4.post0multidict Version
-yarl Version
-OS
Windows 10
Related component
Server
Additional context
No response
Code of Conduct