diff options
| author | Barry Warsaw | 2015-01-04 20:20:33 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2015-01-04 20:20:33 -0500 |
| commit | 4a612db8e89afed74173b93f3b64fa567b8417a3 (patch) | |
| tree | 81a687d113079a25f93279f35c7eee2aa2572510 /src/mailman/handlers/tagger.py | |
| parent | 84af79988a4e916604cba31843778206efb7d1b8 (diff) | |
| parent | de181c1a40965a3a7deedd56a034a946f45b6984 (diff) | |
| download | mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.gz mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.zst mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.zip | |
Diffstat (limited to 'src/mailman/handlers/tagger.py')
| -rw-r--r-- | src/mailman/handlers/tagger.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mailman/handlers/tagger.py b/src/mailman/handlers/tagger.py index 803cc6d11..199c5907f 100644 --- a/src/mailman/handlers/tagger.py +++ b/src/mailman/handlers/tagger.py @@ -17,9 +17,6 @@ """Extract topics from the original mail message.""" -from __future__ import absolute_import, print_function, unicode_literals - -__metaclass__ = type __all__ = [ 'Tagger', ] @@ -29,15 +26,14 @@ import re import email.iterators import email.parser -from zope.interface import implementer - from mailman.core.i18n import _ from mailman.interfaces.handler import IHandler +from zope.interface import implementer OR = '|' CRNL = '\r\n' -EMPTYBYTES = b'' +EMPTYSTRING = '' NLTAB = '\n\t' @@ -104,7 +100,7 @@ def scanbody(msg, numlines=None): reader = list(email.iterators.body_line_iterator(msg)) while numlines is None or lineno < numlines: try: - line = bytes(reader.pop(0)) + line = reader.pop(0) except IndexError: break # Blank lines don't count @@ -115,7 +111,7 @@ def scanbody(msg, numlines=None): # Concatenate those body text lines with newlines, and then create a new # message object from those lines. p = _ForgivingParser() - msg = p.parsestr(EMPTYBYTES.join(lines)) + msg = p.parsestr(EMPTYSTRING.join(lines)) return msg.get_all('subject', []) + msg.get_all('keywords', []) |
