data._init(): use 'portage' default in first call v2.2.0_alpha80
authorZac Medico <zmedico@gentoo.org>
Sun, 11 Dec 2011 08:15:16 +0000 (00:15 -0800)
committerZac Medico <zmedico@gentoo.org>
Sun, 11 Dec 2011 08:15:16 +0000 (00:15 -0800)
pym/portage/data.py

index a25b282ab715b55d64c0cbda8b81b82e19362e16..cf94ab0cde7233d36fe0560f98d9bfb00e0f1b4d 100644 (file)
@@ -184,12 +184,10 @@ def _init(settings):
        if '_portage_grpname' not in _initialized_globals and \
                '_portage_username' not in _initialized_globals:
 
-               v = settings.get('PORTAGE_GRPNAME')
-               if v is not None:
-                       globals()['_portage_grpname'] = v
-                       _initialized_globals.add('_portage_grpname')
-
-               v = settings.get('PORTAGE_USERNAME')
-               if v is not None:
-                       globals()['_portage_username'] = v
-                       _initialized_globals.add('_portage_username')
+               v = settings.get('PORTAGE_GRPNAME', 'portage')
+               globals()['_portage_grpname'] = v
+               _initialized_globals.add('_portage_grpname')
+
+               v = settings.get('PORTAGE_USERNAME', 'portage')
+               globals()['_portage_username'] = v
+               _initialized_globals.add('_portage_username')