commit:     5fa68f485b77b4d95da777fd0621431de4418644
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  3 02:21:15 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun  3 02:21:15 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5fa68f48

bin: lock-helper.py: move portage import/settings down

They're all in the same place now and it matches what we do in some
other files.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/lock-helper.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/lock-helper.py b/bin/lock-helper.py
index 172c18affd..555fcaf9b8 100755
--- a/bin/lock-helper.py
+++ b/bin/lock-helper.py
@@ -5,11 +5,14 @@
 import os
 import sys
 
-sys.path.insert(0, os.environ["PORTAGE_PYM_PATH"])
-import portage
-
 
 def main(args):
+    sys.path.insert(0, os.environ["PORTAGE_PYM_PATH"])
+    import portage
+
+    portage._internal_caller = True
+    portage._disable_legacy_globals()
+
     if args and isinstance(args[0], bytes):
         for i, x in enumerate(args):
             args[i] = portage._unicode_decode(x, errors="strict")
@@ -26,8 +29,5 @@ def main(args):
 
 
 if __name__ == "__main__":
-    portage._internal_caller = True
-    portage._disable_legacy_globals()
-
     rval = main(sys.argv[1:])
     sys.exit(rval)

Reply via email to