From 54f0222547b1e92cd018ef132307a6f793dc9505 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 1 Jun 2002 14:18:47 +0000 Subject: SF 563203. Replaced 'has_key()' with 'in'. --- Lib/ftplib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/ftplib.py') diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 4a3d884eef..2e5cb33756 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -660,7 +660,7 @@ class Netrc: def __init__(self, filename=None): if filename is None: - if os.environ.has_key("HOME"): + if "HOME" in os.environ: filename = os.path.join(os.environ["HOME"], ".netrc") else: @@ -714,7 +714,7 @@ class Netrc: self.__defpasswd = passwd or self.__defpasswd self.__defacct = acct or self.__defacct if host: - if self.__hosts.has_key(host): + if host in self.__hosts: ouser, opasswd, oacct = \ self.__hosts[host] user = user or ouser @@ -736,7 +736,7 @@ class Netrc: """ host = host.lower() user = passwd = acct = None - if self.__hosts.has_key(host): + if host in self.__hosts: user, passwd, acct = self.__hosts[host] user = user or self.__defuser passwd = passwd or self.__defpasswd -- cgit v1.2.1