Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
90134c9a
Commit
90134c9a
authored
May 30, 2007
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have MimeWriter raise a DeprecationWarning as per PEP 4 and its documentation.
parent
b4eec28e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
0 deletions
+13
-0
Lib/MimeWriter.py
Lib/MimeWriter.py
+5
-0
Lib/test/test_MimeWriter.py
Lib/test/test_MimeWriter.py
+4
-0
Lib/test/test___all__.py
Lib/test/test___all__.py
+2
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/MimeWriter.py
View file @
90134c9a
...
...
@@ -14,6 +14,11 @@ import mimetools
__all__
=
[
"MimeWriter"
]
import
warnings
warnings
.
warn
(
"the MimeWriter module is deprecated; use the email package instead"
,
DeprecationWarning
,
2
)
class
MimeWriter
:
"""Generic MIME writer.
...
...
Lib/test/test_MimeWriter.py
View file @
90134c9a
...
...
@@ -10,6 +10,10 @@ This should generate Barry's example, modulo some quotes and newlines.
import
unittest
,
sys
,
StringIO
from
test.test_support
import
run_unittest
import
warnings
warnings
.
filterwarnings
(
"ignore"
,
"the MimeWriter module is deprecated.*"
,
DeprecationWarning
)
from
MimeWriter
import
MimeWriter
SELLER
=
'''
\
...
...
Lib/test/test___all__.py
View file @
90134c9a
...
...
@@ -7,6 +7,8 @@ warnings.filterwarnings("ignore", "the sets module is deprecated",
DeprecationWarning
,
"<string>"
)
warnings
.
filterwarnings
(
"ignore"
,
".*popen2 module is deprecated.*"
,
DeprecationWarning
)
warnings
.
filterwarnings
(
"ignore"
,
"the MimeWriter module is deprecated.*"
,
DeprecationWarning
)
class
AllTest
(
unittest
.
TestCase
):
...
...
Misc/NEWS
View file @
90134c9a
...
...
@@ -220,6 +220,8 @@ Core and builtins
Library
-------
- MimeWriter now raises a DeprecationWarning upon import.
- tarfile.py: Improved unicode support. Unicode input names are now
officially supported. Added "errors" argument to the TarFile class.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment