summaryrefslogtreecommitdiff
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index aae38d5abf..163c00c445 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -267,8 +267,8 @@ def expanduser(path):
except KeyError:
return path
userhome = pwent.pw_dir
- userhome = userhome.rstrip('/') or userhome
- return userhome + path[i:]
+ userhome = userhome.rstrip('/')
+ return (userhome + path[i:]) or '/'
# Expand paths containing shell variable substitutions.