run_app() the keword
loop was added, which is mandatory if you don’t want aiohttp to start a new event loop but use your previous created one.
This works fine, but i need a solution that supports aiohttp 3.7.x and 3.8.x. My first thought was to create a helper function in my project like that:
import inspect from aiohttp.web import run_app as _run_app def run_app(*args, **kwargs): if 'loop' in kwargs: arg_spec = inspect.getfullargspec(_run_app) if 'loop' not in arg_spec.kwonlyargs: kwargs.pop('loop') return _run_app(*args, **kwargs)
Is there a better solution?