[MERGE] An SMTPConnection class for bzrlib
Adeodato Simó
dato at net.com.org.es
Wed Jun 20 01:00:48 BST 2007
* John Arbash Meinel [Tue, 19 Jun 2007 16:55:22 -0500]:
> There is a small (major?) problem in that in python2.4 they are called
> "email.Utils" and in python2.5 they are called "email.utils". Come to think of
> it, that case isn't handled in the patch (bzr-email does).
> In bzr-email I do:
> try:
> # python <= 2.4
> from email.MIMEText import MIMEText
> from email.MIMEMultipart import MIMEMultipart
> from email.Utils import parseaddr
> except ImportError:
> # python 2.5 moved MIMEText into a better namespace
> from email.mime.text import MIMEText
> from email.mime.multipart import MIMEMultipart
> from email.utils import parseaddr
I saw that in bzr-email, of course. However, importing the uppercase
modules does not raise an exception in python 2.5, and I can't see any
mention of this issue in the What's New document, nor a Warning is
raised, so I assume the upper case modules are not going away, and will
never raise an ImportError.
If with this explanation you would still like to see the try/except
block, just say so and I'll add it. But I think it's unnecessary. :-)
Cheers,
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
We may not return the affection of those who like us, but we always
respect their good judgement.
More information about the bazaar
mailing list