Skip to content

Commit 5a68d55

Browse files
fix: use anyio.Event for _stop_event in non-pyodide environments
1 parent 7265157 commit 5a68d55

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/hmr/reactivity/hmr/core.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,10 @@ def keep_watching_until_interrupt(self):
347347
class AsyncReloader(BaseReloader):
348348
@cached_property
349349
def _stop_event(self):
350-
from asyncio import Event
351-
350+
if sys.platform == "emscripten":
351+
from asyncio import Event
352+
else:
353+
from anyio import Event
352354
return Event()
353355

354356
def stop_watching(self):

0 commit comments

Comments
 (0)