1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Use builtin TimeoutError [core + helpers] (#109684)

This commit is contained in:
Marc Mueller
2024-02-05 12:09:54 +01:00
committed by GitHub
parent a9147cf3dd
commit cd0ee98dba
19 changed files with 70 additions and 74 deletions

View File

@@ -875,7 +875,7 @@ class HomeAssistant:
tasks.append(task_or_none)
if tasks:
await asyncio.gather(*tasks, return_exceptions=True)
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.warning(
"Timed out waiting for shutdown jobs to complete, the shutdown will"
" continue"
@@ -906,7 +906,7 @@ class HomeAssistant:
try:
async with self.timeout.async_timeout(STOP_STAGE_SHUTDOWN_TIMEOUT):
await self.async_block_till_done()
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.warning(
"Timed out waiting for integrations to stop, the shutdown will"
" continue"
@@ -919,7 +919,7 @@ class HomeAssistant:
try:
async with self.timeout.async_timeout(FINAL_WRITE_STAGE_SHUTDOWN_TIMEOUT):
await self.async_block_till_done()
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.warning(
"Timed out waiting for final writes to complete, the shutdown will"
" continue"
@@ -951,7 +951,7 @@ class HomeAssistant:
await task
except asyncio.CancelledError:
pass
except asyncio.TimeoutError:
except TimeoutError:
# Task may be shielded from cancellation.
_LOGGER.exception(
"Task %s could not be canceled during final shutdown stage", task
@@ -971,7 +971,7 @@ class HomeAssistant:
try:
async with self.timeout.async_timeout(CLOSE_STAGE_SHUTDOWN_TIMEOUT):
await self.async_block_till_done()
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.warning(
"Timed out waiting for close event to be processed, the shutdown will"
" continue"