diff mbox series

[10/11] bitbake-setup: Set function default to None

Message ID 20260326185742.542268-11-rob.woolley@windriver.com
State New
Headers show
Series [01/11] bitbake-setup: Remove extraneous variable from str.format() | expand

Commit Message

Rob Woolley March 26, 2026, 6:57 p.m. UTC
The function defaults are evaluated once and use across calls
can lead to unexpected behaviour.

Set the value to none and let the function initialize the value
in the case when the value is not set.

Resolves B006 from flake8-bugbear

Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
 bin/bitbake-setup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 2e1e347d6..6b210cd3e 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -45,7 +45,7 @@  def color_enabled() -> bool:
 def get_diff_color_param() -> str:
     return "--color=always" if color_enabled() else "--color=never"
 
-def print_configs(prompt: str, choices: list[str], descriptions: list[str] = []):
+def print_configs(prompt: str, choices: list[str], descriptions: list[str] = None):
     """
     Helper function to print a list of choices and align the output.
     Each option name is made bold to stand out, unless color is not enabled in