diff options
author | Georg Brandl <georg@python.org> | 2008-06-12 22:23:59 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-06-12 22:23:59 (GMT) |
commit | 9f0f960d4ce48062dcb286903721fa89d6037159 (patch) | |
tree | 4640c5dd2f0ffc54affa131fe6b48cb70d480b71 /Tools | |
parent | a0c0a4a2616e83084052a34c9806b3308f5799db (diff) | |
download | cpython-9f0f960d4ce48062dcb286903721fa89d6037159.zip cpython-9f0f960d4ce48062dcb286903721fa89d6037159.tar.gz cpython-9f0f960d4ce48062dcb286903721fa89d6037159.tar.bz2 |
Remove traces of rfc822.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/faqwiz/faqwiz.py | 4 | ||||
-rwxr-xr-x | Tools/scripts/mailerdaemon.py | 10 | ||||
-rw-r--r-- | Tools/versioncheck/pyversioncheck.py | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Tools/faqwiz/faqwiz.py b/Tools/faqwiz/faqwiz.py index 15342f1..260e1aa 100644 --- a/Tools/faqwiz/faqwiz.py +++ b/Tools/faqwiz/faqwiz.py @@ -207,8 +207,8 @@ class FaqEntry: self.file = file self.sec, self.num = sec_num if fp: - import rfc822 - self.__headers = rfc822.Message(fp) + import email + self.__headers = email.message_from_file(fp) self.body = fp.read().strip() else: self.__headers = {'title': "%d.%d. " % sec_num} diff --git a/Tools/scripts/mailerdaemon.py b/Tools/scripts/mailerdaemon.py index ee4199e..4934b92 100755 --- a/Tools/scripts/mailerdaemon.py +++ b/Tools/scripts/mailerdaemon.py @@ -1,16 +1,16 @@ """mailerdaemon - classes to parse mailer-daemon messages""" -import rfc822 import calendar +import email.message import re import os import sys Unparseable = 'mailerdaemon.Unparseable' -class ErrorMessage(rfc822.Message): - def __init__(self, fp): - rfc822.Message.__init__(self, fp) +class ErrorMessage(email.message.Message): + def __init__(self): + email.message.Message.__init__(self) self.sub = '' def is_warning(self): @@ -169,7 +169,7 @@ def parsedir(dir, modify): for fn in files: # Lets try to parse the file. fp = open(fn) - m = ErrorMessage(fp) + m = email.message_from_file(fp, _class=ErrorMessage) sender = m.getaddr('From') print('%s\t%-40s\t'%(fn, sender[1]), end=' ') diff --git a/Tools/versioncheck/pyversioncheck.py b/Tools/versioncheck/pyversioncheck.py index 8826555..e5983fd 100644 --- a/Tools/versioncheck/pyversioncheck.py +++ b/Tools/versioncheck/pyversioncheck.py @@ -1,6 +1,6 @@ """pyversioncheck - Module to help with checking versions""" -import rfc822 import urllib +import email import sys # Verbose options @@ -52,7 +52,7 @@ def _check1version(package, url, version, verbose=0): if verbose >= VERBOSE_EACHFILE: print(' Cannot open:', arg) return -1, None, None - msg = rfc822.Message(fp, seekable=0) + msg = email.message_from_file(fp) newversion = msg.get('current-version') if not newversion: if verbose >= VERBOSE_EACHFILE: |