summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-08-09 23:06:16 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-08-09 23:06:16 (GMT)
commitc1b76e4aaa094eae58abe96628b958c8fe40639d (patch)
treeb327bfef5634d501d0935f43077d453fb4226572
parent76b8bee26d242e7fea4d8e42be375d2072225564 (diff)
downloadcpython-c1b76e4aaa094eae58abe96628b958c8fe40639d.zip
cpython-c1b76e4aaa094eae58abe96628b958c8fe40639d.tar.gz
cpython-c1b76e4aaa094eae58abe96628b958c8fe40639d.tar.bz2
Suppress the warning in asynchat from using buffer() when running udner -3.
Naively removing the usage causes a large number of test failures, so it was just easier to suppress the warning.
-rw-r--r--Lib/asynchat.py6
-rw-r--r--Misc/NEWS2
2 files changed, 6 insertions, 2 deletions
diff --git a/Lib/asynchat.py b/Lib/asynchat.py
index 8a7176d..121b467 100644
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -49,6 +49,8 @@ you - by calling your self.found_terminator() method.
import socket
import asyncore
from collections import deque
+from test.test_support import catch_warning
+from warnings import filterwarnings
class async_chat (asyncore.dispatcher):
"""This is an abstract class. You must derive from this class, and add
@@ -216,7 +218,9 @@ class async_chat (asyncore.dispatcher):
# handle classic producer behavior
obs = self.ac_out_buffer_size
try:
- data = buffer(first, 0, obs)
+ with catch_warning(record=False):
+ filterwarnings("ignore", ".*buffer", DeprecationWarning)
+ data = buffer(first, 0, obs)
except TypeError:
data = first.more()
if data:
diff --git a/Misc/NEWS b/Misc/NEWS
index 9aebd12..582bd22 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -56,7 +56,7 @@ Library
the reload() built-in has been removed.
- Changed code in the following modules/packages to remove warnings raised
- while running under the ``-3`` flag: aifc, asyncore, bdb, bsddb,
+ while running under the ``-3`` flag: aifc, asynchat, asyncore, bdb, bsddb,
ConfigParser, cookielib, DocXMLRPCServer, email, filecmp, fileinput, inspect,
logging, modulefinder, pdb, pickle, profile, pstats, pydoc, re, rlcompleter,
SimpleXMLRPCServer, shelve, socket, subprocess, sqlite3, tarfile, Tkinter,