ruff: Fix RUF015 Prefer next(iter(…))
over single element slice.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
610683ea41
commit
347490c647
2 changed files with 3 additions and 3 deletions
|
@ -1023,9 +1023,9 @@ def add_zulip_subscriptions(verbose: bool) -> None:
|
||||||
unauthorized = res.get("unauthorized")
|
unauthorized = res.get("unauthorized")
|
||||||
if verbose:
|
if verbose:
|
||||||
if already is not None and len(already) > 0:
|
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:
|
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:
|
if unauthorized is not None and len(unauthorized) > 0:
|
||||||
logger.info(
|
logger.info(
|
||||||
"\n%s\n\n %s",
|
"\n%s\n\n %s",
|
||||||
|
|
|
@ -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
|
# exist in the configuration provided via the environment
|
||||||
# variable, use the first bot in the environment variable,
|
# variable, use the first bot in the environment variable,
|
||||||
# with name updated to match, along with a warning.
|
# 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]
|
bots_config[bot_name] = env_config[first_bot_name]
|
||||||
logging.warning(
|
logging.warning(
|
||||||
"First bot name in the config list was changed from %r to %r",
|
"First bot name in the config list was changed from %r to %r",
|
||||||
|
|
Loading…
Add table
Reference in a new issue