| OLD | NEW |
| 1 """Various tools used by MIME-reading or MIME-writing programs.""" | 1 """Various tools used by MIME-reading or MIME-writing programs.""" |
| 2 | 2 |
| 3 | 3 |
| 4 import os | 4 import os |
| 5 import sys |
| 5 import tempfile | 6 import tempfile |
| 6 from test.test_support import catch_warning | 7 from warnings import filterwarnings, catch_warnings |
| 7 from warnings import filterwarnings | 8 with catch_warnings(record=False): |
| 8 with catch_warning(record=False): | 9 if sys.py3kwarning: |
| 9 filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning) | 10 filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning
) |
| 10 import rfc822 | 11 import rfc822 |
| 11 | 12 |
| 12 from warnings import warnpy3k | 13 from warnings import warnpy3k |
| 13 warnpy3k("in 3.x, mimetools has been removed in favor of the email package", | 14 warnpy3k("in 3.x, mimetools has been removed in favor of the email package", |
| 14 stacklevel=2) | 15 stacklevel=2) |
| 15 | 16 |
| 16 __all__ = ["Message","choose_boundary","encode","decode","copyliteral", | 17 __all__ = ["Message","choose_boundary","encode","decode","copyliteral", |
| 17 "copybinary"] | 18 "copybinary"] |
| 18 | 19 |
| 19 class Message(rfc822.Message): | 20 class Message(rfc822.Message): |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 line = input.readline() | 241 line = input.readline() |
| 241 if not line: break | 242 if not line: break |
| 242 output.write(line) | 243 output.write(line) |
| 243 | 244 |
| 244 def copybinary(input, output): | 245 def copybinary(input, output): |
| 245 BUFSIZE = 8192 | 246 BUFSIZE = 8192 |
| 246 while 1: | 247 while 1: |
| 247 line = input.read(BUFSIZE) | 248 line = input.read(BUFSIZE) |
| 248 if not line: break | 249 if not line: break |
| 249 output.write(line) | 250 output.write(line) |
| OLD | NEW |