From 347490c647165b1ea42b0953f236d5a52f2ae0da Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 30 Oct 2023 10:59:16 -0700 Subject: [PATCH] =?UTF-8?q?ruff:=20Fix=20RUF015=20Prefer=20`next(iter(?= =?UTF-8?q?=E2=80=A6))`=20over=20single=20element=20slice.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders Kaseorg --- zulip/integrations/zephyr/zephyr_mirror_backend.py | 4 ++-- zulip_botserver/zulip_botserver/server.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zulip/integrations/zephyr/zephyr_mirror_backend.py b/zulip/integrations/zephyr/zephyr_mirror_backend.py index 650dffaf..0f620b6e 100755 --- a/zulip/integrations/zephyr/zephyr_mirror_backend.py +++ b/zulip/integrations/zephyr/zephyr_mirror_backend.py @@ -1023,9 +1023,9 @@ def add_zulip_subscriptions(verbose: bool) -> None: unauthorized = res.get("unauthorized") if verbose: if already is not None and len(already) > 0: - logger.info("\nAlready subscribed to: %s", ", ".join(list(already.values())[0])) + logger.info("\nAlready subscribed to: %s", ", ".join(next(iter(already.values())))) if new is not None and len(new) > 0: - logger.info("\nSuccessfully subscribed to: %s", ", ".join(list(new.values())[0])) + logger.info("\nSuccessfully subscribed to: %s", ", ".join(next(iter(new.values())))) if unauthorized is not None and len(unauthorized) > 0: logger.info( "\n%s\n\n %s", diff --git a/zulip_botserver/zulip_botserver/server.py b/zulip_botserver/zulip_botserver/server.py index 6531e64d..e81c5498 100755 --- a/zulip_botserver/zulip_botserver/server.py +++ b/zulip_botserver/zulip_botserver/server.py @@ -50,7 +50,7 @@ def read_config_from_env_vars(bot_name: Optional[str] = None) -> Dict[str, Dict[ # exist in the configuration provided via the environment # variable, use the first bot in the environment variable, # with name updated to match, along with a warning. - first_bot_name = list(env_config.keys())[0] + first_bot_name = next(iter(env_config.keys())) bots_config[bot_name] = env_config[first_bot_name] logging.warning( "First bot name in the config list was changed from %r to %r",