Skip to content

Commit

Permalink
Handle change in wait_closed() behavior in python 3.12 (Fixes #177)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Nov 8, 2023
1 parent d8d2667 commit 5550b20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/microdot_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ async def aclose(self):

while True:
try:
if hasattr(self.server, 'serve_forever'): # pragma: no cover
try:
await self.server.serve_forever()
except asyncio.CancelledError:
pass
await self.server.wait_closed()
break
except AttributeError: # pragma: no cover
Expand Down

0 comments on commit 5550b20

Please sign in to comment.