diff --git a/fastapi/security/oauth2.py b/fastapi/security/oauth2.py index 99fa1d829..494b8a5f0 100644 --- a/fastapi/security/oauth2.py +++ b/fastapi/security/oauth2.py @@ -1,17 +1,16 @@ from typing import Any, Dict, List, Optional, Union, cast -from starlette.requests import Request -from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN - -# TODO: import from typing when deprecating Python 3.9 -from typing_extensions import Annotated, Doc - from fastapi.exceptions import HTTPException from fastapi.openapi.models import OAuth2 as OAuth2Model from fastapi.openapi.models import OAuthFlows as OAuthFlowsModel from fastapi.param_functions import Form from fastapi.security.base import SecurityBase from fastapi.security.utils import get_authorization_scheme_param +from starlette.requests import Request +from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN + +# TODO: import from typing when deprecating Python 3.9 +from typing_extensions import Annotated, Doc class OAuth2PasswordRequestForm: @@ -726,9 +725,7 @@ class SecurityScopes: The list of all the scopes required by dependencies. """ ), - ] = ( - scopes or [] - ) + ] = scopes or [] self.scope_str: Annotated[ str, Doc(