catch CancelledError in lifespan hack for windows (#4083)
This commit is contained in:
parent
12b81ad754
commit
1f3be6340c
@ -19,10 +19,13 @@ async def windows_hot_reload_lifespan_hack():
|
|||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
while True:
|
try:
|
||||||
sys.stderr.write("\0")
|
while True:
|
||||||
sys.stderr.flush()
|
sys.stderr.write("\0")
|
||||||
await asyncio.sleep(0.5)
|
sys.stderr.flush()
|
||||||
|
await asyncio.sleep(0.5)
|
||||||
|
except asyncio.CancelledError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
|
Loading…
Reference in New Issue
Block a user