diff mbox series

[v2,01/10] bitbake-setup: Add the conditional script stanza

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

Commit Message

Rob Woolley Jan. 27, 2026, 4:04 p.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>
---
 bin/bitbake-setup | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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