mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-08-20 13:17:35 +00:00
Move read_text
to executor (#5688)
* Move read_text to executor * Fix issues found by coderabbit * formated to formatted * switch to async_capture_exception * Find and replace got one too many * Update patch mock to async_capture_exception * Drop Sentry capture from format_message The error handling got introduced in #2052, however, #2100 essentially makes sure there will never be a byte object passed to this function. And even if, the Sentry aiohttp plug-in will properly catch such an exception. --------- Co-authored-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
"""Bootstrap Supervisor."""
|
||||
|
||||
# ruff: noqa: T100
|
||||
from importlib import import_module
|
||||
import logging
|
||||
import os
|
||||
import signal
|
||||
@ -306,12 +307,12 @@ def reg_signal(loop, coresys: CoreSys) -> None:
|
||||
_LOGGER.warning("Could not bind to SIGINT")
|
||||
|
||||
|
||||
def supervisor_debugger(coresys: CoreSys) -> None:
|
||||
async def supervisor_debugger(coresys: CoreSys) -> None:
|
||||
"""Start debugger if needed."""
|
||||
if not coresys.config.debug:
|
||||
return
|
||||
# pylint: disable=import-outside-toplevel
|
||||
import debugpy
|
||||
|
||||
debugpy = await coresys.run_in_executor(import_module, "debugpy")
|
||||
|
||||
_LOGGER.info("Initializing Supervisor debugger")
|
||||
|
||||
|
Reference in New Issue
Block a user