diff options
author | Fred Drake <fdrake@acm.org> | 2000-12-12 23:20:45 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-12-12 23:20:45 (GMT) |
commit | 8152d32375c40bba9ccbe43b780ebe96d9617781 (patch) | |
tree | f10aba5ba6f1e3064b26d2edfd6fffb45378245d /Lib/nntplib.py | |
parent | c140131995c67b1cd001b5c27e0095c53b1204b4 (diff) | |
download | cpython-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/nntplib.py')
-rw-r--r-- | Lib/nntplib.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/nntplib.py b/Lib/nntplib.py index 7a90543..526677a 100644 --- a/Lib/nntplib.py +++ b/Lib/nntplib.py @@ -258,7 +258,7 @@ class NNTP: - name: the group name""" resp = self.shortcmd('GROUP ' + name) - if resp[:3] <> '211': + if resp[:3] != '211': raise NNTPReplyError(resp) words = string.split(resp) count = first = last = 0 @@ -282,7 +282,7 @@ class NNTP: def statparse(self, resp): """Internal: parse the response of a STAT, NEXT or LAST command.""" - if resp[:2] <> '22': + if resp[:2] != '22': raise NNTPReplyError(resp) words = string.split(resp) nr = 0 @@ -429,7 +429,7 @@ class NNTP: path: directory path to article""" resp = self.shortcmd("XPATH " + id) - if resp[:3] <> '223': + if resp[:3] != '223': raise NNTPReplyError(resp) try: [resp_num, path] = string.split(resp) @@ -447,7 +447,7 @@ class NNTP: time: Time suitable for newnews/newgroups commands etc.""" resp = self.shortcmd("DATE") - if resp[:3] <> '111': + if resp[:3] != '111': raise NNTPReplyError(resp) elem = string.split(resp) if len(elem) != 2: @@ -467,7 +467,7 @@ class NNTP: resp = self.shortcmd('POST') # Raises error_??? if posting is not allowed - if resp[0] <> '3': + if resp[0] != '3': raise NNTPReplyError(resp) while 1: line = f.readline() @@ -491,7 +491,7 @@ class NNTP: resp = self.shortcmd('IHAVE ' + id) # Raises error_??? if the server already has it - if resp[0] <> '3': + if resp[0] != '3': raise NNTPReplyError(resp) while 1: line = f.readline() |