Skip to content

Commit 29b8f27

Browse files
committed
unify the definition of _main_exceptions
1 parent 5882c92 commit 29b8f27

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

django_valkey/async_cache/client/herd.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import socket
2-
31
from valkey import Valkey
4-
from valkey.exceptions import ConnectionError, ResponseError, TimeoutError
52
from valkey.typing import KeyT, EncodableT
63

74
from django_valkey.async_cache.client import AsyncDefaultClient
8-
from django_valkey.base_client import DEFAULT_TIMEOUT, HerdCommonMethods
5+
from django_valkey.base_client import (
6+
DEFAULT_TIMEOUT,
7+
HerdCommonMethods,
8+
_main_exceptions,
9+
)
910
from django_valkey.exceptions import ConnectionInterrupted
1011

11-
_main_exceptions = (ConnectionError, ResponseError, TimeoutError, socket.timeout)
12-
1312

1413
class AsyncHerdClient(HerdCommonMethods, AsyncDefaultClient):
1514
async def set(

django_valkey/client/herd.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
import socket
21
from collections.abc import Iterable
32
from typing import Any
43

54
from valkey import Valkey
6-
from valkey.exceptions import ConnectionError, ResponseError, TimeoutError
75
from valkey.typing import KeyT, EncodableT
86

97
from django_valkey.base_client import (
108
DEFAULT_TIMEOUT,
119
Backend,
1210
HerdCommonMethods,
11+
_main_exceptions,
1312
)
1413
from django_valkey.client.default import DefaultClient
1514
from django_valkey.exceptions import ConnectionInterrupted
1615

17-
_main_exceptions = (ConnectionError, ResponseError, TimeoutError, socket.timeout)
18-
1916

2017
class HerdClient(HerdCommonMethods, DefaultClient):
2118
def set(

0 commit comments

Comments
 (0)