pmb: Replace list(...)[0] with next(iter(...)) (MR 2525)

See https://docs.astral.sh/ruff/rules/unnecessary-iterable-allocation-for-first-element
This commit is contained in:
Newbyte 2025-01-08 00:05:29 +01:00 committed by Oliver Smith
parent 752c1df039
commit c2787aa76f
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 3 additions and 3 deletions

View file

@ -399,7 +399,7 @@ def ask_for_device_kernel(config: Config, device: str) -> str:
# Get default
default = config.kernel
if default not in kernels:
default = list(kernels.keys())[0]
default = next(iter(kernels.keys()))
# Ask for kernel (extra message when downstream and upstream are available)
logging.info("Which kernel do you want to use with your device?")