diff mbox series

[1/3] lib/oe: remove redundant __name__ == "__main__" checks

Message ID 20250402170235.2868624-1-ross.burton@arm.com
State Accepted, archived
Commit 020b6b1411c9fd3adb208808c0d56623190873f8
Headers show
Series [1/3] lib/oe: remove redundant __name__ == "__main__" checks | expand

Commit Message

Ross Burton April 2, 2025, 5:02 p.m. UTC
There's no point in checking if __name__ == "__main__" (i.e., is this
module being invoked) and then doing nothing.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/lib/oe/manifest.py | 4 ----
 meta/lib/oe/rootfs.py   | 9 ---------
 meta/lib/oe/sdk.py      | 3 ---
 3 files changed, 16 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index 61f18adc4ac..cf7a13c2475 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -200,7 +200,3 @@  def create_manifest(d, final_manifest=False, manifest_dir=None,
         manifest.create_final()
     else:
         manifest.create_initial()
-
-
-if __name__ == "__main__":
-    pass
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 90d49749653..6b56adaf031 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -427,12 +427,3 @@  def image_list_installed_packages(d, rootfs_dir=None):
     import importlib
     cls = importlib.import_module('oe.package_manager.' + img_type)
     return cls.PMPkgsList(d, rootfs_dir).list_pkgs()
-
-if __name__ == "__main__":
-    """
-    We should be able to run this as a standalone script, from outside bitbake
-    environment.
-    """
-    """
-    TBD
-    """
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index 3dc3672210b..11759aba489 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -155,6 +155,3 @@  def get_extra_sdkinfo(sstate_dir):
                 extra_info['tasksizes'][task] = origtotal + fsize
                 extra_info['filesizes'][fn] = fsize
     return extra_info
-
-if __name__ == "__main__":
-    pass