Skip to content

Commit

Permalink
Catch the right exception
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed Feb 4, 2025
1 parent bc2527d commit 77a6451
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions homeassistant/components/backup/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import asyncio
from collections.abc import AsyncIterator, Callable, Coroutine
from concurrent.futures import Future
from concurrent.futures import CancelledError, Future
import copy
from dataclasses import dataclass, replace
from io import BytesIO
Expand Down Expand Up @@ -198,7 +198,7 @@ def read(self, n: int = -1, /) -> bytes:
raise AbortCipher
try:
self._buffer = self._next_future.result()
except asyncio.CancelledError as err:
except CancelledError as err:
raise AbortCipher from err
self._pos = 0
if not self._buffer:
Expand Down Expand Up @@ -257,7 +257,7 @@ def write(self, s: bytes, /) -> int:
raise AbortCipher
try:
self._write_future.result()
except asyncio.CancelledError as err:
except CancelledError as err:
raise AbortCipher from err
self._pos += len(s)
return len(s)
Expand Down

0 comments on commit 77a6451

Please sign in to comment.