Skip to content

Commit

Permalink
Fix clobbering of sockets list from constructor
Browse files Browse the repository at this point in the history
Co-authored-by: Florimond Manca <florimond.manca@protonmail.com>
  • Loading branch information
bwhmather and florimondmanca committed Jun 29, 2022
1 parent 0ecc6af commit 483949b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions uvicorn/server.py
Expand Up @@ -120,10 +120,10 @@ async def serve(self, sockets: Optional[List[socket.socket]] = None) -> None:
if self._main_task is not None:
raise RuntimeError("cannot call serve on running server")

if sockets is not None and self._sockets is not None:
raise RuntimeError("cannot override already provided sockets list")

self._sockets = sockets
if sockets is not None:
if self._sockets is not None:
raise RuntimeError("cannot override already provided sockets list")
self._sockets = sockets

self.install_signal_handlers()
try:
Expand Down

0 comments on commit 483949b

Please sign in to comment.