mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
SF # 555779, import user doesn't work with CGIs
This commit is contained in:
parent
bd9adab138
commit
609ba81cdb
2 changed files with 6 additions and 2 deletions
|
@ -303,8 +303,10 @@ def expanduser(path):
|
|||
i = i + 1
|
||||
if i == 1:
|
||||
if not 'HOME' in os.environ:
|
||||
return path
|
||||
userhome = os.environ['HOME']
|
||||
import pwd
|
||||
userhome = pwd.getpwuid(os.getuid())[5]
|
||||
else:
|
||||
userhome = os.environ['HOME']
|
||||
else:
|
||||
import pwd
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue