diff -r c8d8a6cc5586 Lib/email/__init__.py --- a/Lib/email/__init__.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/__init__.py Sun May 04 15:30:08 2014 +0200 @@ -27,7 +27,6 @@ ] - # Some convenience routines. Don't import Parser and Message as side-effects # of importing email since those cascadingly import most of the rest of the # email package. diff -r c8d8a6cc5586 Lib/email/base64mime.py --- a/Lib/email/base64mime.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/base64mime.py Sun May 04 15:30:08 2014 +0200 @@ -45,7 +45,6 @@ MISC_LEN = 7 - # Helpers def header_length(bytearray): """Return the length of s when it is encoded with base64.""" @@ -57,7 +56,6 @@ return n - def header_encode(header_bytes, charset='iso-8859-1'): """Encode a single header line with Base64 encoding in a given charset. @@ -72,7 +70,6 @@ return '=?%s?b?%s?=' % (charset, encoded) - def body_encode(s, maxlinelen=76, eol=NL): r"""Encode a string with base64. @@ -98,7 +95,6 @@ return EMPTYSTRING.join(encvec) - def decode(string): """Decode a raw base64 string, returning a bytes object. diff -r c8d8a6cc5586 Lib/email/charset.py --- a/Lib/email/charset.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/charset.py Sun May 04 15:30:08 2014 +0200 @@ -18,7 +18,6 @@ from email.encoders import encode_7or8bit - # Flags for types of header encodings QP = 1 # Quoted-Printable BASE64 = 2 # Base64 @@ -32,7 +31,6 @@ EMPTYSTRING = '' - # Defaults CHARSETS = { # input header enc body enc output conv @@ -104,7 +102,6 @@ } - # Convenience functions for extending the above mappings def add_charset(charset, header_enc=None, body_enc=None, output_charset=None): """Add character set properties to the global registry. @@ -153,7 +150,6 @@ CODEC_MAP[charset] = codecname - # Convenience function for encoding strings, taking into account # that they might be unknown-8bit (ie: have surrogate-escaped bytes) def _encode(string, codec): @@ -163,7 +159,6 @@ return string.encode(codec) - class Charset: """Map character sets to their email properties. diff -r c8d8a6cc5586 Lib/email/encoders.py --- a/Lib/email/encoders.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/encoders.py Sun May 04 15:30:08 2014 +0200 @@ -16,7 +16,6 @@ from quopri import encodestring as _encodestring - def _qencode(s): enc = _encodestring(s, quotetabs=True) # Must encode spaces, which quopri.encodestring() doesn't do @@ -34,7 +33,6 @@ msg['Content-Transfer-Encoding'] = 'base64' - def encode_quopri(msg): """Encode the message's payload in quoted-printable. @@ -46,7 +44,6 @@ msg['Content-Transfer-Encoding'] = 'quoted-printable' - def encode_7or8bit(msg): """Set the Content-Transfer-Encoding header to 7bit or 8bit.""" orig = msg.get_payload(decode=True) @@ -64,6 +61,5 @@ msg['Content-Transfer-Encoding'] = '7bit' - def encode_noop(msg): """Do nothing.""" diff -r c8d8a6cc5586 Lib/email/feedparser.py --- a/Lib/email/feedparser.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/feedparser.py Sun May 04 15:30:08 2014 +0200 @@ -40,7 +40,6 @@ NeedMoreData = object() - class BufferedSubFile(object): """A file-ish object that can have new data loaded into it. @@ -122,7 +121,6 @@ return line - class FeedParser: """A feed-style parser of email.""" diff -r c8d8a6cc5586 Lib/email/generator.py --- a/Lib/email/generator.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/generator.py Sun May 04 15:30:08 2014 +0200 @@ -21,7 +21,6 @@ fcre = re.compile(r'^From ', re.MULTILINE) - class Generator: """Generates output from a Message object tree. @@ -382,7 +381,6 @@ def _compile_re(cls, s, flags): return re.compile(s, flags) - class BytesGenerator(Generator): """Generates a bytes version of a Message object tree. @@ -437,7 +435,6 @@ return re.compile(s.encode('ascii'), flags) - _FMT = '[Non-text (%(type)s) part of message omitted, filename %(filename)s]' class DecodedGenerator(Generator): @@ -495,7 +492,6 @@ }, file=self) - # Helper used by Generator._make_boundary _width = len(repr(sys.maxsize-1)) _fmt = '%%0%dd' % _width diff -r c8d8a6cc5586 Lib/email/header.py --- a/Lib/email/header.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/header.py Sun May 04 15:30:08 2014 +0200 @@ -52,12 +52,10 @@ _embeded_header = re.compile(r'\n[^ \t]+:') - # Helpers _max_append = email.quoprimime._max_append - def decode_header(header): """Decode a message header value without converting charset. @@ -152,7 +150,6 @@ return collapsed - def make_header(decoded_seq, maxlinelen=None, header_name=None, continuation_ws=' '): """Create a Header from a sequence of pairs as returned by decode_header() @@ -175,7 +172,6 @@ return h - class Header: def __init__(self, s=None, charset=None, maxlinelen=None, header_name=None, @@ -412,7 +408,6 @@ self._chunks = chunks - class _ValueFormatter: def __init__(self, headerlen, maxlen, continuation_ws, splitchars): self._maxlen = maxlen diff -r c8d8a6cc5586 Lib/email/iterators.py --- a/Lib/email/iterators.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/iterators.py Sun May 04 15:30:08 2014 +0200 @@ -15,7 +15,6 @@ from io import StringIO - # This function will become a method of the Message class def walk(self): """Walk over the message tree, yielding each subpart. @@ -29,7 +28,6 @@ yield from subpart.walk() - # These two functions are imported into the Iterators.py interface module. def body_line_iterator(msg, decode=False): """Iterate over the parts, returning string payloads line-by-line. @@ -55,7 +53,6 @@ yield subpart - def _structure(msg, fp=None, level=0, include_default=False): """A handy debugging aid""" if fp is None: diff -r c8d8a6cc5586 Lib/email/message.py --- a/Lib/email/message.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/message.py Sun May 04 15:30:08 2014 +0200 @@ -35,7 +35,7 @@ if not sep: return a.strip(), None return a.strip(), b.strip() - + def _formatparam(param, value=None, quote=True): """Convenience function to format and return a key=value pair. @@ -101,7 +101,6 @@ return utils.unquote(value) - class Message: """Basic message object. diff -r c8d8a6cc5586 Lib/email/mime/audio.py --- a/Lib/email/mime/audio.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/mime/audio.py Sun May 04 15:30:08 2014 +0200 @@ -13,7 +13,6 @@ from email.mime.nonmultipart import MIMENonMultipart - _sndhdr_MIMEmap = {'au' : 'basic', 'wav' :'x-wav', 'aiff':'x-aiff', @@ -38,7 +37,6 @@ return None - class MIMEAudio(MIMENonMultipart): """Class for generating audio/* MIME documents.""" diff -r c8d8a6cc5586 Lib/email/mime/base.py --- a/Lib/email/mime/base.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/mime/base.py Sun May 04 15:30:08 2014 +0200 @@ -9,7 +9,6 @@ from email import message - class MIMEBase(message.Message): """Base class for MIME specializations.""" diff -r c8d8a6cc5586 Lib/email/mime/image.py --- a/Lib/email/mime/image.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/mime/image.py Sun May 04 15:30:08 2014 +0200 @@ -12,7 +12,6 @@ from email.mime.nonmultipart import MIMENonMultipart - class MIMEImage(MIMENonMultipart): """Class for generating image/* type MIME documents.""" diff -r c8d8a6cc5586 Lib/email/mime/message.py --- a/Lib/email/mime/message.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/mime/message.py Sun May 04 15:30:08 2014 +0200 @@ -10,7 +10,6 @@ from email.mime.nonmultipart import MIMENonMultipart - class MIMEMessage(MIMENonMultipart): """Class representing message/* MIME documents.""" diff -r c8d8a6cc5586 Lib/email/mime/multipart.py --- a/Lib/email/mime/multipart.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/mime/multipart.py Sun May 04 15:30:08 2014 +0200 @@ -9,7 +9,6 @@ from email.mime.base import MIMEBase - class MIMEMultipart(MIMEBase): """Base class for MIME multipart/* type messages.""" diff -r c8d8a6cc5586 Lib/email/mime/nonmultipart.py --- a/Lib/email/mime/nonmultipart.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/mime/nonmultipart.py Sun May 04 15:30:08 2014 +0200 @@ -10,7 +10,6 @@ from email.mime.base import MIMEBase - class MIMENonMultipart(MIMEBase): """Base class for MIME multipart/* type messages.""" diff -r c8d8a6cc5586 Lib/email/mime/text.py --- a/Lib/email/mime/text.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/mime/text.py Sun May 04 15:30:08 2014 +0200 @@ -9,7 +9,6 @@ from email.mime.nonmultipart import MIMENonMultipart - class MIMEText(MIMENonMultipart): """Class for generating text/* type MIME documents.""" diff -r c8d8a6cc5586 Lib/email/parser.py --- a/Lib/email/parser.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/email/parser.py Sun May 04 15:30:08 2014 +0200 @@ -13,7 +13,6 @@ from email._policybase import compat32 - class Parser: def __init__(self, _class=None, *, policy=compat32): """Parser of RFC 2822 and MIME email messages. @@ -68,7 +67,6 @@ return self.parse(StringIO(text), headersonly=headersonly) - class HeaderParser(Parser): def parse(self, fp, headersonly=True): return Parser.parse(self, fp, True) @@ -76,7 +74,6 @@ def parsestr(self, text, headersonly=True): return Parser.parsestr(self, text, True) - class BytesParser: def __init__(self, *args, **kw): diff -r c8d8a6cc5586 Lib/test/test_email/test_asian_codecs.py --- a/Lib/test/test_email/test_asian_codecs.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/test/test_email/test_asian_codecs.py Sun May 04 15:30:08 2014 +0200 @@ -18,7 +18,6 @@ raise unittest.SkipTest - class TestEmailAsianCodecs(TestEmailBase): def test_japanese_codecs(self): eq = self.ndiffAssertEqual @@ -77,6 +76,5 @@ self.assertEqual(jhello, ustr) - if __name__ == '__main__': unittest.main() diff -r c8d8a6cc5586 Lib/test/test_email/torture_test.py --- a/Lib/test/test_email/torture_test.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/test/test_email/torture_test.py Sun May 04 15:30:08 2014 +0200 @@ -31,7 +31,6 @@ raise TestSkipped - class TortureBase(TestEmailBase): def _msgobj(self, filename): fp = openfile(filename) @@ -42,7 +41,6 @@ return msg - class TestCrispinTorture(TortureBase): # Mark Crispin's torture test from the SquirrelMail project def test_mondo_message(self): @@ -113,7 +111,7 @@ audio/x-sun """) - + def _testclasses(): mod = sys.modules[__name__] return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] @@ -131,6 +129,5 @@ run_unittest(testclass) - if __name__ == '__main__': unittest.main(defaultTest='suite') diff -r c8d8a6cc5586 Lib/test/test_isinstance.py --- a/Lib/test/test_isinstance.py Thu Apr 24 19:39:18 2014 -0400 +++ b/Lib/test/test_isinstance.py Sun May 04 15:30:08 2014 +0200 @@ -7,7 +7,6 @@ import sys - class TestIsInstanceExceptions(unittest.TestCase): # Test to make sure that an AttributeError when accessing the instance's # class's bases is masked. This was actually a bug in Python 2.2 and @@ -96,7 +95,6 @@ class D: pass self.assertRaises(RuntimeError, isinstance, c, D) - # These tests are similar to above, but tickle certain code paths in # issubclass() instead of isinstance() -- really PyObject_IsSubclass() # vs. PyObject_IsInstance(). @@ -146,7 +144,6 @@ self.assertRaises(TypeError, issubclass, B, C()) - # meta classes for creating abstract classes and instances class AbstractClass(object): def __init__(self, bases): @@ -187,7 +184,6 @@ pass - class TestIsInstanceIsSubclass(unittest.TestCase): # Tests to ensure that isinstance and issubclass work on abstract # classes and instances. Before the 2.2 release, TypeErrors were @@ -276,7 +272,6 @@ tuple_arg = (tuple_arg,) fxn(arg, tuple_arg) - def test_main(): support.run_unittest( TestIsInstanceExceptions,