Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ba76e8

Browse files
committed
Use absolute import paths for intrapackage imports.
as_string(): Use Generator.flatten() for better performance.
1 parent 524af6f commit 8ba76e8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/email/Message.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from types import ListType, StringType
1111

1212
# Intrapackage imports
13-
import Errors
14-
import Utils
15-
import Charset
13+
from email import Errors
14+
from email import Utils
15+
from email import Charset
1616

1717
SEMISPACE = '; '
1818

@@ -78,10 +78,10 @@ def as_string(self, unixfrom=0):
7878
Optional `unixfrom' when true, means include the Unix From_ envelope
7979
header.
8080
"""
81-
from Generator import Generator
81+
from email.Generator import Generator
8282
fp = StringIO()
8383
g = Generator(fp)
84-
g(self, unixfrom=unixfrom)
84+
g.flatten(self, unixfrom=unixfrom)
8585
return fp.getvalue()
8686

8787
def is_multipart(self):

0 commit comments

Comments
 (0)