mirror of
https://github.com/python/cpython
synced 2024-10-05 13:24:42 +00:00
Use absolute import paths for intrapackage imports.
as_string(): Use Generator.flatten() for better performance.
This commit is contained in:
parent
524af6f382
commit
8ba76e8929
|
@ -10,9 +10,9 @@
|
|||
from types import ListType, StringType
|
||||
|
||||
# Intrapackage imports
|
||||
import Errors
|
||||
import Utils
|
||||
import Charset
|
||||
from email import Errors
|
||||
from email import Utils
|
||||
from email import Charset
|
||||
|
||||
SEMISPACE = '; '
|
||||
|
||||
|
@ -78,10 +78,10 @@ def as_string(self, unixfrom=0):
|
|||
Optional `unixfrom' when true, means include the Unix From_ envelope
|
||||
header.
|
||||
"""
|
||||
from Generator import Generator
|
||||
from email.Generator import Generator
|
||||
fp = StringIO()
|
||||
g = Generator(fp)
|
||||
g(self, unixfrom=unixfrom)
|
||||
g.flatten(self, unixfrom=unixfrom)
|
||||
return fp.getvalue()
|
||||
|
||||
def is_multipart(self):
|
||||
|
|
Loading…
Reference in a new issue