Skip to content

Commit 955cda4

Browse files
committed
bpo-32601: Let test_expanduser use the same user if no others found
This happens in the NixOS build sandbox, for example, where the only other user is nobody with home directory /. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 7464e87 commit 955cda4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_pathlib.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,9 @@ def test_expanduser(self):
21452145
otherhome = pwdent.pw_dir.rstrip('/')
21462146
if othername != username and otherhome:
21472147
break
2148+
else:
2149+
othername = username
2150+
otherhome = userhome
21482151

21492152
p1 = P('~/Documents')
21502153
p2 = P('~' + username + '/Documents')

0 commit comments

Comments
 (0)