Update the code to better reflect recommended style:

Use != instead of <> since <> is documented as "obsolescent".
Use "is" and "is not" when comparing with None or type objects.
This commit is contained in:
Fred Drake 2000-12-12 23:20:45 +00:00
parent c140131995
commit 8152d32375
36 changed files with 101 additions and 99 deletions

View file

@ -319,7 +319,7 @@ class SMTP:
if code == -1 and len(msg) == 0:
raise SMTPServerDisconnected("Server not connected")
self.ehlo_resp=msg
if code<>250:
if code != 250:
return (code,msg)
self.does_esmtp=1
#parse the ehlo response -ddm
@ -378,7 +378,7 @@ class SMTP:
self.putcmd("data")
(code,repl)=self.getreply()
if self.debuglevel >0 : print "data:", (code,repl)
if code <> 354:
if code != 354:
raise SMTPDataError(code,repl)
else:
q = quotedata(msg)
@ -475,7 +475,7 @@ class SMTP:
esmtp_opts.append(option)
(code,resp) = self.mail(from_addr, esmtp_opts)
if code <> 250:
if code != 250:
self.rset()
raise SMTPSenderRefused(code, resp, from_addr)
senderrs={}
@ -483,14 +483,14 @@ class SMTP:
to_addrs = [to_addrs]
for each in to_addrs:
(code,resp)=self.rcpt(each, rcpt_options)
if (code <> 250) and (code <> 251):
if (code != 250) and (code != 251):
senderrs[each]=(code,resp)
if len(senderrs)==len(to_addrs):
# the server refused all our recipients
self.rset()
raise SMTPRecipientsRefused(senderrs)
(code,resp)=self.data(msg)
if code <> 250:
(code,resp) = self.data(msg)
if code != 250:
self.rset()
raise SMTPDataError(code, resp)
#if we got here then somebody got our mail