mercurial/mail.py
changeset 43156 0e6a7ce81dde
parent 43117 8ff1ecfadcd1
child 43169 3941e7063d03
--- a/mercurial/mail.py	Thu Oct 10 10:03:01 2019 +0200
+++ b/mercurial/mail.py	Thu Oct 10 10:48:57 2019 +0200
@@ -9,6 +9,7 @@
 
 import email
 import email.charset
+import email.generator
 import email.header
 import email.message
 import email.parser
@@ -420,6 +421,8 @@
 
 if pycompat.ispy3:
 
+    Generator = email.generator.BytesGenerator
+
     def parse(fp):
         ep = email.parser.Parser()
         # disable the "universal newlines" mode, which isn't binary safe.
@@ -436,6 +439,8 @@
 
 else:
 
+    Generator = email.generator.Generator
+
     def parse(fp):
         ep = email.parser.Parser()
         return ep.parse(fp)