Remove profiler from mypy ignore list (#74453)

This commit is contained in:
epenet 2022-07-11 18:34:27 +02:00 committed by GitHub
parent 8d6925b3ab
commit ba18e11308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 9 deletions

View File

@ -7,7 +7,7 @@ import sys
import threading import threading
import time import time
import traceback import traceback
from typing import Any from typing import Any, cast
import voluptuous as vol import voluptuous as vol
@ -123,10 +123,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
for thread in threading.enumerate(): for thread in threading.enumerate():
if thread == main_thread: if thread == main_thread:
continue continue
ident = cast(int, thread.ident)
_LOGGER.critical( _LOGGER.critical(
"Thread [%s]: %s", "Thread [%s]: %s",
thread.name, thread.name,
"".join(traceback.format_stack(frames.get(thread.ident))).strip(), "".join(traceback.format_stack(frames.get(ident))).strip(),
) )
async def _async_dump_scheduled(call: ServiceCall) -> None: async def _async_dump_scheduled(call: ServiceCall) -> None:
@ -136,13 +137,14 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
original_maxother = arepr.maxother original_maxother = arepr.maxother
arepr.maxstring = 300 arepr.maxstring = 300
arepr.maxother = 300 arepr.maxother = 300
handle: asyncio.Handle
try: try:
for handle in hass.loop._scheduled: # pylint: disable=protected-access for handle in getattr(hass.loop, "_scheduled"):
if not handle.cancelled(): if not handle.cancelled():
_LOGGER.critical("Scheduled: %s", handle) _LOGGER.critical("Scheduled: %s", handle)
finally: finally:
arepr.max_string = original_maxstring arepr.maxstring = original_maxstring
arepr.max_other = original_maxother arepr.maxother = original_maxother
async_register_admin_service( async_register_admin_service(
hass, hass,

View File

@ -2719,9 +2719,6 @@ ignore_errors = true
[mypy-homeassistant.components.plex.media_player] [mypy-homeassistant.components.plex.media_player]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.profiler]
ignore_errors = true
[mypy-homeassistant.components.sonos] [mypy-homeassistant.components.sonos]
ignore_errors = true ignore_errors = true

View File

@ -37,7 +37,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.onvif.device", "homeassistant.components.onvif.device",
"homeassistant.components.onvif.sensor", "homeassistant.components.onvif.sensor",
"homeassistant.components.plex.media_player", "homeassistant.components.plex.media_player",
"homeassistant.components.profiler",
"homeassistant.components.sonos", "homeassistant.components.sonos",
"homeassistant.components.sonos.alarms", "homeassistant.components.sonos.alarms",
"homeassistant.components.sonos.binary_sensor", "homeassistant.components.sonos.binary_sensor",