mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
error message if console is running
This commit is contained in:
@@ -43,7 +43,16 @@ def _run_devtools(verbose: bool, exclude: list[str] | None = None) -> None:
|
||||
def noop_print(_: str):
|
||||
return None
|
||||
|
||||
run_app(app, port=DEVTOOLS_PORT, print=noop_print, loop=asyncio.get_event_loop())
|
||||
try:
|
||||
run_app(
|
||||
app, port=DEVTOOLS_PORT, print=noop_print, loop=asyncio.get_event_loop()
|
||||
)
|
||||
except OSError:
|
||||
from rich import print
|
||||
|
||||
print()
|
||||
print("[bold red]Couldn't start server")
|
||||
print("Is there another instance of [reverse]textual devtools[/] running?")
|
||||
|
||||
|
||||
def _make_devtools_aiohttp_app(
|
||||
|
||||
Reference in New Issue
Block a user