Skip to content

Commit

Permalink
Deprecate ServerState in the main module
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Feb 12, 2025
1 parent 9d7a483 commit 38e9632
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uvicorn/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,10 @@ def run(


def __getattr__(name: str) -> Any:
# Deprecate ServerState
if name == "ServerState":
warnings.warn(
"uvicorn.main.ServerState is deprecated, use uvicorn.server.ServerState instead.", DeprecationWarning
"uvicorn.main.ServerState is deprecated, use uvicorn.server.ServerState instead.",
DeprecationWarning,
)
from uvicorn.server import ServerState

Expand Down

0 comments on commit 38e9632

Please sign in to comment.