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",