mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
SF 563203. Replaced 'has_key()' with 'in'.
This commit is contained in:
parent
9d5e4aa414
commit
54f0222547
54 changed files with 243 additions and 222 deletions
|
@ -24,11 +24,11 @@ wishes to do different things depending on the Python version.
|
|||
import os
|
||||
|
||||
home = os.curdir # Default
|
||||
if os.environ.has_key('HOME'):
|
||||
if 'HOME' in os.environ:
|
||||
home = os.environ['HOME']
|
||||
elif os.name == 'nt': # Contributed by Jeff Bauer
|
||||
if os.environ.has_key('HOMEPATH'):
|
||||
if os.environ.has_key('HOMEDRIVE'):
|
||||
if 'HOMEPATH' in os.environ:
|
||||
if 'HOMEDRIVE' in os.environ:
|
||||
home = os.environ['HOMEDRIVE'] + os.environ['HOMEPATH']
|
||||
else:
|
||||
home = os.environ['HOMEPATH']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue