diff options
author | pxinwr <peixing.xin@windriver.com> | 2020-12-18 03:22:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 20:22:29 +0100 |
commit | 75dabfe7a8324a16687959cc401deb72b104a575 (patch) | |
tree | 9423e81bae68dad85ee0387c42dfb474a71e2191 /Lib/posixpath.py | |
parent | [doc] Fix a few margins due to bad markup (GH-23619) (diff) | |
download | cpython-75dabfe7a8324a16687959cc401deb72b104a575.tar.gz cpython-75dabfe7a8324a16687959cc401deb72b104a575.tar.bz2 cpython-75dabfe7a8324a16687959cc401deb72b104a575.zip |
bpo-31904: posixpath.expanduser() handles None user home on VxWorks (GH-23530)
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r-- | Lib/posixpath.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py index ecb4e5a8f70..62afbd0ccf0 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -262,6 +262,9 @@ def expanduser(path): # password database, return the path unchanged return path userhome = pwent.pw_dir + # if no user home, return the path unchanged on VxWorks + if userhome is None and sys.platform == "vxworks": + return path if isinstance(path, bytes): userhome = os.fsencode(userhome) root = b'/' |