mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
ruff: Fix SIM105 Use contextlib.suppress instead of try-except-pass.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
b0e569f07c
commit
ff1971f5ad
@@ -2,6 +2,7 @@
|
||||
# This tools generates /etc/zulip/zulip-secrets.conf
|
||||
import os
|
||||
import sys
|
||||
from contextlib import suppress
|
||||
from typing import Dict, List
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
@@ -166,10 +167,8 @@ def generate_secrets(development: bool = False) -> None:
|
||||
)
|
||||
break
|
||||
|
||||
try:
|
||||
with suppress(redis.exceptions.ConnectionError):
|
||||
get_redis_client().config_set("requirepass", redis_password)
|
||||
except redis.exceptions.ConnectionError:
|
||||
pass
|
||||
|
||||
add_secret("redis_password", redis_password)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user