diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-09-02 01:25:16 +0000 |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-09-02 01:25:16 +0000 |
commit | ebc44960de91b0963456c93068daaa374a51f1c1 (patch) | |
tree | f1c88baa3c400d28a8c035120923da72d3852ca1 /Lib/BaseHTTPServer.py | |
parent | a8997ce0a9a3093d5a638210d64c565d8a51980e (diff) | |
download | cpython-ebc44960de91b0963456c93068daaa374a51f1c1.tar.gz |
Move test.test_support.catch_warning() to the warnings module, rename it
catch_warnings(), and clean up the API.
While expanding the test suite, a bug was found where a warning about the
'line' argument to showwarning() was not letting functions with '*args' go
without a warning.
Closes issue 3602.
Code review by Benjamin Peterson.
Diffstat (limited to 'Lib/BaseHTTPServer.py')
-rw-r--r-- | Lib/BaseHTTPServer.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/BaseHTTPServer.py b/Lib/BaseHTTPServer.py index 0a6381e422..acd839410e 100644 --- a/Lib/BaseHTTPServer.py +++ b/Lib/BaseHTTPServer.py @@ -73,11 +73,11 @@ __all__ = ["HTTPServer", "BaseHTTPRequestHandler"] import sys import time import socket # For gethostbyaddr() -from test.test_support import catch_warning -from warnings import filterwarnings -with catch_warning(record=False): - filterwarnings("ignore", ".*mimetools has been removed", - DeprecationWarning) +from warnings import filterwarnings, catch_warnings +with catch_warnings(): + if sys.py3kwarning: + filterwarnings("ignore", ".*mimetools has been removed", + DeprecationWarning) import mimetools import SocketServer |