Skip to content

Commit 0662fc9

Browse files
committed
Initialise asyncio.Event in the event loop
1 parent e3c1379 commit 0662fc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sphinx_autobuild/server.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ def __init__(
2828
self.paths = [Path(path).resolve(strict=True) for path in paths]
2929
self.ignore = ignore_filter
3030
self.change_callback = change_callback
31-
self.flag = asyncio.Event()
32-
self.should_exit = asyncio.Event()
3331

3432
@asynccontextmanager
3533
async def lifespan(self, _app) -> AbstractAsyncContextManager[None]:
34+
self.flag = asyncio.Event()
35+
self.should_exit = asyncio.Event()
3636
task = asyncio.create_task(self.main())
3737
yield
3838
self.should_exit.set()

0 commit comments

Comments
 (0)