summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 6c66689..d5d2621 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -303,8 +303,10 @@ def expanduser(path):
i = i + 1
if i == 1:
if not 'HOME' in os.environ:
- return path
- userhome = os.environ['HOME']
+ import pwd
+ userhome = pwd.getpwuid(os.getuid())[5]
+ else:
+ userhome = os.environ['HOME']
else:
import pwd
try: