bump ruff and do fixes (#2375)

This commit is contained in:
Hayden
2023-05-05 14:43:23 -08:00
committed by GitHub
parent f27bb00dc3
commit 23786c1f5e
8 changed files with 26 additions and 30 deletions

View File

@@ -116,9 +116,7 @@ def _register_endpoints(router: APIRouter, cls: type[Any], *urls: str) -> None:
raise Exception("An identical route role has been implemented more then once")
numbered_routes_by_endpoint = {
route.endpoint: (i, route)
for i, route in enumerate(router.routes)
if isinstance(route, (Route, WebSocketRoute))
route.endpoint: (i, route) for i, route in enumerate(router.routes) if isinstance(route, Route | WebSocketRoute)
}
prefix_length = len(router.prefix)