mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
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.
This commit is contained in:
parent
76b8bee26d
commit
c1b76e4aaa
2 changed files with 6 additions and 2 deletions
|
@ -49,6 +49,8 @@ you - by calling your self.found_terminator() method.
|
||||||
import socket
|
import socket
|
||||||
import asyncore
|
import asyncore
|
||||||
from collections import deque
|
from collections import deque
|
||||||
|
from test.test_support import catch_warning
|
||||||
|
from warnings import filterwarnings
|
||||||
|
|
||||||
class async_chat (asyncore.dispatcher):
|
class async_chat (asyncore.dispatcher):
|
||||||
"""This is an abstract class. You must derive from this class, and add
|
"""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
|
# handle classic producer behavior
|
||||||
obs = self.ac_out_buffer_size
|
obs = self.ac_out_buffer_size
|
||||||
try:
|
try:
|
||||||
data = buffer(first, 0, obs)
|
with catch_warning(record=False):
|
||||||
|
filterwarnings("ignore", ".*buffer", DeprecationWarning)
|
||||||
|
data = buffer(first, 0, obs)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
data = first.more()
|
data = first.more()
|
||||||
if data:
|
if data:
|
||||||
|
|
|
@ -56,7 +56,7 @@ Library
|
||||||
the reload() built-in has been removed.
|
the reload() built-in has been removed.
|
||||||
|
|
||||||
- Changed code in the following modules/packages to remove warnings raised
|
- 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,
|
ConfigParser, cookielib, DocXMLRPCServer, email, filecmp, fileinput, inspect,
|
||||||
logging, modulefinder, pdb, pickle, profile, pstats, pydoc, re, rlcompleter,
|
logging, modulefinder, pdb, pickle, profile, pstats, pydoc, re, rlcompleter,
|
||||||
SimpleXMLRPCServer, shelve, socket, subprocess, sqlite3, tarfile, Tkinter,
|
SimpleXMLRPCServer, shelve, socket, subprocess, sqlite3, tarfile, Tkinter,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue