diff --git a/src/aiohttp_middlewares/annotations.py b/src/aiohttp_middlewares/annotations.py index cf22edf..80badee 100644 --- a/src/aiohttp_middlewares/annotations.py +++ b/src/aiohttp_middlewares/annotations.py @@ -24,12 +24,11 @@ from yarl import URL try: - # (<3.9.0) Try to import Middleware from aiohttp.web_middlewares - Middleware = importlib.import_module('aiohttp.web_middlewares')._Middleware + # (<3.9.0) Try to import Middleware from aiohttp.web_middlewares + Middleware = importlib.import_module('aiohttp.web_middlewares')._Middleware except AttributeError: - # (>=3.9.0) If that fails, import Middleware from aiohttp.typedefs - Middleware = importlib.import_module('aiohttp.typedefs').Middleware - + # (>=3.9.0) If that fails, import Middleware from aiohttp.typedefs + Middleware = importlib.import_module('aiohttp.typedefs').Middleware # Make flake8 happy (Middleware,)