Skip to content

Commit 73be24a

Browse files
committed
explicit loop
1 parent 6961c78 commit 73be24a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/textual_dev/server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,17 @@ def _run_devtools(
4646
def noop_print(_: str) -> None:
4747
pass
4848

49+
try:
50+
loop = asyncio.get_event_loop()
51+
except RuntimeError:
52+
loop = asyncio.new_event_loop()
53+
4954
try:
5055
run_app(
5156
app,
5257
port=DEVTOOLS_PORT if port is None else port,
5358
print=noop_print,
59+
loop=loop,
5460
)
5561
except OSError:
5662
from rich import print

0 commit comments

Comments
 (0)