mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-32601: Let test_expanduser use the same user if no others found. (GH-5246)
This happens in the NixOS build sandbox, for example, where the only other user is nobody with home directory /.
This commit is contained in:
parent
5cd22cf209
commit
5c0d462689
1 changed files with 3 additions and 0 deletions
|
@ -2142,6 +2142,9 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
|
||||||
otherhome = pwdent.pw_dir.rstrip('/')
|
otherhome = pwdent.pw_dir.rstrip('/')
|
||||||
if othername != username and otherhome:
|
if othername != username and otherhome:
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
othername = username
|
||||||
|
otherhome = userhome
|
||||||
|
|
||||||
p1 = P('~/Documents')
|
p1 = P('~/Documents')
|
||||||
p2 = P('~' + username + '/Documents')
|
p2 = P('~' + username + '/Documents')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue