summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-10 02:28:34 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-10 02:28:34 -0700
commit5c325c04d52484646c2b3f70b759b92fe50be9e6 (patch)
treed8700029dbb8921eb8fb2d6fbe4f28e26da394a7
parent41fb4cd560fd0f915cc0d1a3766b6a642fab58cd (diff)
downloadportage-5c325c04d52484646c2b3f70b759b92fe50be9e6.tar.gz
portage-5c325c04d52484646c2b3f70b759b92fe50be9e6.tar.bz2
portage-5c325c04d52484646c2b3f70b759b92fe50be9e6.zip
Don't use os.getlogin() since apparently it's unreliable.
-rwxr-xr-xpym/portage/tests/runTests3
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/portage/tests/runTests b/pym/portage/tests/runTests
index 9600f12a7..05dd773c9 100755
--- a/pym/portage/tests/runTests
+++ b/pym/portage/tests/runTests
@@ -6,11 +6,12 @@
import os, sys
import os.path as osp
import grp
+import pwd
# Pretend that the current user's uid/gid are the 'portage' uid/gid,
# so things go smoothly regardless of the current user and global
# user/group configuration.
-os.environ["PORTAGE_USERNAME"] = os.getlogin()
+os.environ["PORTAGE_USERNAME"] = pwd.getpwuid(os.getuid()).pw_name
os.environ["PORTAGE_GRPNAME"] = grp.getgrgid(os.getgid()).gr_name
# Insert our parent dir so we can do shiny import "tests"