summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-08-24 03:53:23 (GMT)
committerGuido van Rossum <guido@python.org>2006-08-24 03:53:23 (GMT)
commitb053cd8f40dd19985b16f50661640dcefb69888f (patch)
tree88e1c2ce636a6df402a97c51ea9067a46735120a /Lib/email
parent01c77c66289f8e9c8d15b8da623fae4014ec2edb (diff)
downloadcpython-b053cd8f40dd19985b16f50661640dcefb69888f.zip
cpython-b053cd8f40dd19985b16f50661640dcefb69888f.tar.gz
cpython-b053cd8f40dd19985b16f50661640dcefb69888f.tar.bz2
Killed the <> operator. You must now use !=.
Opportunistically also fixed one or two places where '<> None' should be 'is not None' and where 'type(x) <> y' should be 'not isinstance(x, y)'.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/base64mime.py2
-rw-r--r--Lib/email/charset.py4
-rw-r--r--Lib/email/generator.py2
-rw-r--r--Lib/email/header.py4
-rw-r--r--Lib/email/message.py12
-rw-r--r--Lib/email/quoprimime.py2
-rw-r--r--Lib/email/test/test_email.py4
-rw-r--r--Lib/email/test/test_email_renamed.py4
8 files changed, 17 insertions, 17 deletions
diff --git a/Lib/email/base64mime.py b/Lib/email/base64mime.py
index 0129d9d..0b29eb8 100644
--- a/Lib/email/base64mime.py
+++ b/Lib/email/base64mime.py
@@ -146,7 +146,7 @@ def encode(s, binary=True, maxlinelen=76, eol=NL):
# BAW: should encode() inherit b2a_base64()'s dubious behavior in
# adding a newline to the encoded string?
enc = b2a_base64(s[i:i + max_unencoded])
- if enc.endswith(NL) and eol <> NL:
+ if enc.endswith(NL) and eol != NL:
enc = enc[:-1] + eol
encvec.append(enc)
return EMPTYSTRING.join(encvec)
diff --git a/Lib/email/charset.py b/Lib/email/charset.py
index 8f218b2..882aa42 100644
--- a/Lib/email/charset.py
+++ b/Lib/email/charset.py
@@ -250,7 +250,7 @@ class Charset:
Returns "base64" if self.body_encoding is BASE64.
Returns "7bit" otherwise.
"""
- assert self.body_encoding <> SHORTEST
+ assert self.body_encoding != SHORTEST
if self.body_encoding == QP:
return 'quoted-printable'
elif self.body_encoding == BASE64:
@@ -260,7 +260,7 @@ class Charset:
def convert(self, s):
"""Convert a string from the input_codec to the output_codec."""
- if self.input_codec <> self.output_codec:
+ if self.input_codec != self.output_codec:
return unicode(s, self.input_codec).encode(self.output_codec)
else:
return s
diff --git a/Lib/email/generator.py b/Lib/email/generator.py
index 6e7a515..ed832a3 100644
--- a/Lib/email/generator.py
+++ b/Lib/email/generator.py
@@ -211,7 +211,7 @@ class Generator:
# doesn't preserve newlines/continuations in headers. This is no big
# deal in practice, but turns out to be inconvenient for the unittest
# suite.
- if msg.get_boundary() <> boundary:
+ if msg.get_boundary() != boundary:
msg.set_boundary(boundary)
# If there's a preamble, write it out, with a trailing CRLF
if msg.preamble is not None:
diff --git a/Lib/email/header.py b/Lib/email/header.py
index 183c337..3de44f9 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -248,7 +248,7 @@ class Header:
elif not isinstance(charset, Charset):
charset = Charset(charset)
# If the charset is our faux 8bit charset, leave the string unchanged
- if charset <> '8bit':
+ if charset != '8bit':
# We need to test that the string can be converted to unicode and
# back to a byte string, given the input and output codecs of the
# charset.
@@ -454,7 +454,7 @@ def _split_ascii(s, firstlen, restlen, continuation_ws, splitchars):
# If this part is longer than maxlen and we aren't already
# splitting on whitespace, try to recursively split this line
# on whitespace.
- if partlen > maxlen and ch <> ' ':
+ if partlen > maxlen and ch != ' ':
subl = _split_ascii(part, maxlen, restlen,
continuation_ws, ' ')
lines.extend(subl[:-1])
diff --git a/Lib/email/message.py b/Lib/email/message.py
index 6110131..9d25cb0 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -252,7 +252,7 @@ class Message:
charset=charset.get_output_charset())
else:
self.set_param('charset', charset.get_output_charset())
- if str(charset) <> charset.get_output_charset():
+ if str(charset) != charset.get_output_charset():
self._payload = charset.body_encode(self._payload)
if 'Content-Transfer-Encoding' not in self:
cte = charset.get_body_encoding()
@@ -301,7 +301,7 @@ class Message:
name = name.lower()
newheaders = []
for k, v in self._headers:
- if k.lower() <> name:
+ if k.lower() != name:
newheaders.append((k, v))
self._headers = newheaders
@@ -438,7 +438,7 @@ class Message:
return self.get_default_type()
ctype = paramre.split(value)[0].lower().strip()
# RFC 2045, section 5.2 says if its invalid, use text/plain
- if ctype.count('/') <> 1:
+ if ctype.count('/') != 1:
return 'text/plain'
return ctype
@@ -601,7 +601,7 @@ class Message:
ctype = append_param
else:
ctype = SEMISPACE.join([ctype, append_param])
- if ctype <> self.get(header):
+ if ctype != self.get(header):
del self[header]
self[header] = ctype
@@ -617,13 +617,13 @@ class Message:
return
new_ctype = ''
for p, v in self.get_params(header=header, unquote=requote):
- if p.lower() <> param.lower():
+ if p.lower() != param.lower():
if not new_ctype:
new_ctype = _formatparam(p, v, requote)
else:
new_ctype = SEMISPACE.join([new_ctype,
_formatparam(p, v, requote)])
- if new_ctype <> self.get(header):
+ if new_ctype != self.get(header):
del self[header]
self[header] = new_ctype
diff --git a/Lib/email/quoprimime.py b/Lib/email/quoprimime.py
index a5658dd..389b276 100644
--- a/Lib/email/quoprimime.py
+++ b/Lib/email/quoprimime.py
@@ -287,7 +287,7 @@ def decode(encoded, eol=NL):
n = len(line)
while i < n:
c = line[i]
- if c <> '=':
+ if c != '=':
decoded += c
i += 1
# Otherwise, c == "=". Are we at the end of the line? If so, add
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py
index 13801dc..8127ef0 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -51,7 +51,7 @@ def openfile(filename, mode='r'):
class TestEmailBase(unittest.TestCase):
def ndiffAssertEqual(self, first, second):
"""Like failUnlessEqual except use ndiff for readable output."""
- if first <> second:
+ if first != second:
sfirst = str(first)
ssecond = str(second)
diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines())
@@ -2726,7 +2726,7 @@ class TestCharset(unittest.TestCase):
# Try a charset with None body encoding
c = Charset('us-ascii')
eq('hello world', c.body_encode('hello world'))
- # Try the convert argument, where input codec <> output codec
+ # Try the convert argument, where input codec != output codec
c = Charset('euc-jp')
# With apologies to Tokio Kikuchi ;)
try:
diff --git a/Lib/email/test/test_email_renamed.py b/Lib/email/test/test_email_renamed.py
index 30f39b9..ce685c5 100644
--- a/Lib/email/test/test_email_renamed.py
+++ b/Lib/email/test/test_email_renamed.py
@@ -52,7 +52,7 @@ def openfile(filename, mode='r'):
class TestEmailBase(unittest.TestCase):
def ndiffAssertEqual(self, first, second):
"""Like failUnlessEqual except use ndiff for readable output."""
- if first <> second:
+ if first != second:
sfirst = str(first)
ssecond = str(second)
diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines())
@@ -2732,7 +2732,7 @@ class TestCharset(unittest.TestCase):
# Try a charset with None body encoding
c = Charset('us-ascii')
eq('hello world', c.body_encode('hello world'))
- # Try the convert argument, where input codec <> output codec
+ # Try the convert argument, where input codec != output codec
c = Charset('euc-jp')
# With apologies to Tokio Kikuchi ;)
try: