Skip to content

Commit 347490c

Browse files
committed
ruff: Fix RUF015 Prefer next(iter(…)) over single element slice.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 610683e commit 347490c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

zulip/integrations/zephyr/zephyr_mirror_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,9 +1023,9 @@ def add_zulip_subscriptions(verbose: bool) -> None:
10231023
unauthorized = res.get("unauthorized")
10241024
if verbose:
10251025
if already is not None and len(already) > 0:
1026-
logger.info("\nAlready subscribed to: %s", ", ".join(list(already.values())[0]))
1026+
logger.info("\nAlready subscribed to: %s", ", ".join(next(iter(already.values()))))
10271027
if new is not None and len(new) > 0:
1028-
logger.info("\nSuccessfully subscribed to: %s", ", ".join(list(new.values())[0]))
1028+
logger.info("\nSuccessfully subscribed to: %s", ", ".join(next(iter(new.values()))))
10291029
if unauthorized is not None and len(unauthorized) > 0:
10301030
logger.info(
10311031
"\n%s\n\n %s",

zulip_botserver/zulip_botserver/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def read_config_from_env_vars(bot_name: Optional[str] = None) -> Dict[str, Dict[
5050
# exist in the configuration provided via the environment
5151
# variable, use the first bot in the environment variable,
5252
# with name updated to match, along with a warning.
53-
first_bot_name = list(env_config.keys())[0]
53+
first_bot_name = next(iter(env_config.keys()))
5454
bots_config[bot_name] = env_config[first_bot_name]
5555
logging.warning(
5656
"First bot name in the config list was changed from %r to %r",

0 commit comments

Comments
 (0)