##// END OF EJS Templates
py3: use email.generator.BytesGenerator in patch.split()...
Denis Laxalde -
r43426:0e6a7ce8 default
parent child Browse files
Show More
@@ -9,6 +9,7 b' from __future__ import absolute_import'
9 9
10 10 import email
11 11 import email.charset
12 import email.generator
12 13 import email.header
13 14 import email.message
14 15 import email.parser
@@ -420,6 +421,8 b' def mimeencode(ui, s, charsets=None, dis'
420 421
421 422 if pycompat.ispy3:
422 423
424 Generator = email.generator.BytesGenerator
425
423 426 def parse(fp):
424 427 ep = email.parser.Parser()
425 428 # disable the "universal newlines" mode, which isn't binary safe.
@@ -436,6 +439,8 b' if pycompat.ispy3:'
436 439
437 440 else:
438 441
442 Generator = email.generator.Generator
443
439 444 def parse(fp):
440 445 ep = email.parser.Parser()
441 446 return ep.parse(fp)
@@ -11,7 +11,6 b' from __future__ import absolute_import, '
11 11 import collections
12 12 import contextlib
13 13 import copy
14 import email
15 14 import errno
16 15 import hashlib
17 16 import os
@@ -107,7 +106,7 b' def split(stream):'
107 106 def mimesplit(stream, cur):
108 107 def msgfp(m):
109 108 fp = stringio()
110 g = email.Generator.Generator(fp, mangle_from_=False)
109 g = mail.Generator(fp, mangle_from_=False)
111 110 g.flatten(m)
112 111 fp.seek(0)
113 112 return fp
General Comments 0
You need to be logged in to leave comments. Login now