diff mbox series

[5/5] bitbake-setup: Add the conditional script stanza

Message ID 20260121024723.2634264-6-rob.woolley@windriver.com
State New
Headers show
Series Package bitbake-setup for PyPI | expand

Commit Message

Rob Woolley Jan. 21, 2026, 2:47 a.m. UTC
This ensures that the main function is only executed if
the module is executed in the top-level environment.

Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
 lib/bitbake_setup/__main__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bitbake_setup/__main__.py b/lib/bitbake_setup/__main__.py
index a69dc750..d23582dd 100755
--- a/lib/bitbake_setup/__main__.py
+++ b/lib/bitbake_setup/__main__.py
@@ -1106,4 +1106,5 @@  def main():
         from argparse import Namespace
         parser.print_help()
 
-main()
+if __name__ == '__main__':
+    main()