python2.4: fix imports of sub-packages of the email package
authorAugie Fackler <raf@durin42.com>
Tue, 24 Sep 2013 15:10:32 -0400
changeset 19810 c80feeb715d1
parent 19809 50d721553198
child 19811 5e10d41e7b9c
python2.4: fix imports of sub-packages of the email package These all have an obvious comment so if/when we finally ditch Python 2.4 we can eradicate them easily.
hgext/notify.py
hgext/patchbomb.py
mercurial/mail.py
mercurial/patch.py
--- a/hgext/notify.py	Fri Sep 20 09:16:07 2013 -0400
+++ b/hgext/notify.py	Tue Sep 24 15:10:32 2013 -0400
@@ -134,6 +134,9 @@
 '''
 
 import email, socket, time
+# On python2.4 you have to import this by name or they fail to
+# load. This was not a problem on Python 2.7.
+import email.Parser
 from mercurial.i18n import _
 from mercurial import patch, cmdutil, templater, util, mail
 import fnmatch
--- a/hgext/patchbomb.py	Fri Sep 20 09:16:07 2013 -0400
+++ b/hgext/patchbomb.py	Tue Sep 24 15:10:32 2013 -0400
@@ -47,6 +47,11 @@
 
 import os, errno, socket, tempfile, cStringIO
 import email
+# On python2.4 you have to import these by name or they fail to
+# load. This was not a problem on Python 2.7.
+import email.Generator
+import email.MIMEMultipart
+
 from mercurial import cmdutil, commands, hg, mail, patch, util
 from mercurial import scmutil
 from mercurial.i18n import _
--- a/mercurial/mail.py	Fri Sep 20 09:16:07 2013 -0400
+++ b/mercurial/mail.py	Tue Sep 24 15:10:32 2013 -0400
@@ -9,6 +9,10 @@
 import util, encoding, sslutil
 import os, smtplib, socket, quopri, time, sys
 import email
+# On python2.4 you have to import these by name or they fail to
+# load. This was not a problem on Python 2.7.
+import email.Header
+import email.MIMEText
 
 _oldheaderinit = email.Header.Header.__init__
 def _unifiedheaderinit(self, *args, **kw):
--- a/mercurial/patch.py	Fri Sep 20 09:16:07 2013 -0400
+++ b/mercurial/patch.py	Tue Sep 24 15:10:32 2013 -0400
@@ -8,6 +8,10 @@
 
 import cStringIO, email, os, errno, re, posixpath
 import tempfile, zlib, shutil
+# On python2.4 you have to import these by name or they fail to
+# load. This was not a problem on Python 2.7.
+import email.Generator
+import email.Parser
 
 from i18n import _
 from node import hex, nullid, short