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 | 96a09df64483b70c4215c7025a19b9d2f1636c55 (diff) | |
| download | cpython-git-75dabfe7a8324a16687959cc401deb72b104a575.tar.gz | |
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 ecb4e5a8f7..62afbd0ccf 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'/' |
