Skip to content

Commit

Permalink
catch CancelledError in lifespan hack for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Lendemor committed Oct 7, 2024
1 parent d77b900 commit afb8d85
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions reflex/utils/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ async def windows_hot_reload_lifespan_hack():
import asyncio
import sys

while True:
sys.stderr.write("\0")
sys.stderr.flush()
await asyncio.sleep(0.5)
try:
while True:
sys.stderr.write("\0")
sys.stderr.flush()
await asyncio.sleep(0.5)
except asyncio.CancelledError:
pass


@contextlib.contextmanager
Expand Down

0 comments on commit afb8d85

Please sign in to comment.