commit:     73514c310754def1f8cb932f00296e008b9d4437
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 26 17:40:33 2022 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 26 17:44:33 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=73514c31

data.py: fix PORTAGE_USERNAME default (bug 873088)

Fix the PORTAGE_USERNAME default for the case where the portage.settings
attribute exists and PORTAGE_USERNAME is unset.

Fixes: 18e5a8170c69aecd10f162918de571d85055ae81
Bug: https://bugs.gentoo.org/873088
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/data.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/portage/data.py b/lib/portage/data.py
index 1ef8d4aef..8aa66df7f 100644
--- a/lib/portage/data.py
+++ b/lib/portage/data.py
@@ -259,7 +259,7 @@ def _get_global(k):
         if env_key in os.environ:
             v = os.environ[env_key]
         elif hasattr(portage, "settings"):
-            v = portage.settings.get(env_key)
+            v = portage.settings.get(env_key, v)
         else:
             # The config class has equivalent code, but we also need to
             # do it here if _disable_legacy_globals() has been called.

Reply via email to