Skip to content

Commit 5882c92

Browse files
committed
rename exceptions so they don't shadow built-in names
1 parent 6186102 commit 5882c92

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

django_valkey/base_client.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
from django.core.exceptions import ImproperlyConfigured
2222
from django.utils.module_loading import import_string
2323

24-
from valkey.exceptions import ConnectionError, ResponseError, TimeoutError
24+
from valkey.exceptions import (
25+
ConnectionError as ValkeyConnectionError,
26+
ResponseError,
27+
TimeoutError as ValkeyTimeoutError,
28+
)
2529
from valkey.typing import AbsExpiryT, EncodableT, ExpiryT, KeyT, PatternT
2630

2731
from django_valkey import pool
@@ -37,7 +41,12 @@
3741
from django_valkey.cache import ValkeyCache
3842

3943

40-
_main_exceptions = (TimeoutError, ResponseError, ConnectionError, socket.timeout)
44+
_main_exceptions = (
45+
ValkeyTimeoutError,
46+
ResponseError,
47+
ValkeyConnectionError,
48+
socket.timeout,
49+
)
4150

4251
special_re = re.compile("([*?[])")
4352

0 commit comments

Comments
 (0)