diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2009-12-04 08:38:06 +0100 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2009-12-04 08:38:06 +0100 |
commit | b96951d6a140b92d033a8d9eb53614e22e30c2c5 (patch) | |
tree | 4704a00f5fa5dbec23a00318e55e8b93828b2fa5 /shellutils.py | |
parent | 11c747eeb4c3109d357f21b745a7d37dd039a664 (diff) | |
parent | e38afc9f25a8d1008bd67a1f678d00806dabc2ab (diff) | |
download | logilab-common-b96951d6a140b92d033a8d9eb53614e22e30c2c5.tar.gz |
merge
Diffstat (limited to 'shellutils.py')
-rw-r--r-- | shellutils.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/shellutils.py b/shellutils.py index ed5d23f..d012bbe 100644 --- a/shellutils.py +++ b/shellutils.py @@ -339,8 +339,9 @@ def getlogin(): (man 3 getlogin) Another solution would be to use $LOGNAME, $USER or $USERNAME """ - import pwd # Platforms: Unix - return pwd.getpwuid(os.getuid())[0] - - + if sys.platform != 'win32': + import pwd # Platforms: Unix + return pwd.getpwuid(os.getuid())[0] + else: + return os.environ['USERNAME'] |