pmb.config.init: Use separate answer variable for sudo timer (MR 2490)

Otherwise mypy gets confused about the type as in this case the variable
gets set to a boolean and not a string.
This commit is contained in:
Newbyte 2024-11-15 13:53:21 +01:00
parent 6026b0e9ee
commit 8d1ff21e9e
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -568,11 +568,11 @@ def ask_for_additional_options(config: Config) -> None:
" internally. For long running operations, it is possible"
" that you'll have to authorize sudo more than once."
)
answer = pmb.helpers.cli.confirm(
answer_background_timer = pmb.helpers.cli.confirm(
"Enable background timer to prevent repeated sudo authorization?",
default=context.sudo_timer,
)
config.sudo_timer = answer
config.sudo_timer = answer_background_timer
# Mirrors
# prompt for mirror change