Skip to content

Commit 0abd91c

Browse files
committed
Merge remote-tracking branch 'origin/use_ruff' into use_ruff
# Conflicts: # django_redis/serializers/pickle.py
2 parents f608da1 + ba065e2 commit 0abd91c

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

django_redis/client/sentinel.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ def connect(self, *args, **kwargs):
3737
"Settings DJANGO_REDIS_CONNECTION_FACTORY or "
3838
"CACHE[].OPTIONS.CONNECTION_POOL_CLASS is not configured correctly."
3939
)
40-
raise ImproperlyConfigured(
41-
error_message
42-
)
40+
raise ImproperlyConfigured(error_message)
4341

4442
return connection

django_redis/pool.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,16 @@ def make_connection_params(self, url):
4848

4949
socket_timeout = self.options.get("SOCKET_TIMEOUT", None)
5050
if socket_timeout:
51-
if not isinstance(
52-
socket_timeout, (int, float)
53-
):
51+
if not isinstance(socket_timeout, (int, float)):
5452
error_message = "Socket timeout should be float or integer"
5553
raise ImproperlyConfigured(error_message)
5654
kwargs["socket_timeout"] = socket_timeout
5755

5856
socket_connect_timeout = self.options.get("SOCKET_CONNECT_TIMEOUT", None)
5957
if socket_connect_timeout:
60-
if not isinstance(
61-
socket_connect_timeout, (int, float)
62-
):
58+
if not isinstance(socket_connect_timeout, (int, float)):
6359
error_message = "Socket connect timeout should be float or integer"
64-
raise ImproperlyConfigured(
65-
error_message
66-
)
60+
raise ImproperlyConfigured(error_message)
6761
kwargs["socket_connect_timeout"] = socket_connect_timeout
6862

6963
return kwargs
@@ -147,9 +141,7 @@ def __init__(self, options):
147141
sentinels = options.get("SENTINELS")
148142
if not sentinels:
149143
error_message = "SENTINELS must be provided as a list of (host, port)."
150-
raise ImproperlyConfigured(
151-
error_message
152-
)
144+
raise ImproperlyConfigured(error_message)
153145

154146
# provide the connection pool kwargs to the sentinel in case it
155147
# needs to use the socket options for the sentinels themselves

django_redis/serializers/pickle.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ def setup_pickle_version(self, options) -> None:
2222
f"PICKLE_VERSION can't be higher than pickle.HIGHEST_PROTOCOL:"
2323
f" {pickle.HIGHEST_PROTOCOL}"
2424
)
25-
raise ImproperlyConfigured(
26-
error_message
27-
)
28-
except (ValueError, TypeError) as e:
25+
raise ImproperlyConfigured(error_message)
26+
except (ValueError, TypeError):
2927
error_message = "PICKLE_VERSION value must be an integer"
3028
raise ImproperlyConfigured(error_message) from e
3129

0 commit comments

Comments
 (0)