mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #24950: Fixed expanduser tests when the users home directory in pwd is "/".
Based on patch by SilentGhost.
This commit is contained in:
commit
0e120525f0
2 changed files with 10 additions and 5 deletions
|
@ -2062,7 +2062,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
|
|||
import pwd
|
||||
pwdent = pwd.getpwuid(os.getuid())
|
||||
username = pwdent.pw_name
|
||||
userhome = pwdent.pw_dir.rstrip('/')
|
||||
userhome = pwdent.pw_dir.rstrip('/') or '/'
|
||||
# find arbitrary different user (if exists)
|
||||
for pwdent in pwd.getpwall():
|
||||
othername = pwdent.pw_name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue