summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-12-12 23:20:45 (GMT)
committerFred Drake <fdrake@acm.org>2000-12-12 23:20:45 (GMT)
commit8152d32375c40bba9ccbe43b780ebe96d9617781 (patch)
treef10aba5ba6f1e3064b26d2edfd6fffb45378245d /Lib/smtplib.py
parentc140131995c67b1cd001b5c27e0095c53b1204b4 (diff)
downloadcpython-8152d32375c40bba9ccbe43b780ebe96d9617781.zip
cpython-8152d32375c40bba9ccbe43b780ebe96d9617781.tar.gz
cpython-8152d32375c40bba9ccbe43b780ebe96d9617781.tar.bz2
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.
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-xLib/smtplib.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 77cd223..064a9f8 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -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