SF 563203. Replaced 'has_key()' with 'in'.

This commit is contained in:
Raymond Hettinger 2002-06-01 14:18:47 +00:00
parent 9d5e4aa414
commit 54f0222547
54 changed files with 243 additions and 222 deletions

View file

@ -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']