Issue 25002: Deprecate asyncore/asynchat. Patch by Mariatta.
This commit is contained in:
parent
1faf9025b5
commit
16591f440d
|
@ -9,6 +9,9 @@
|
||||||
|
|
||||||
**Source code:** :source:`Lib/asynchat.py`
|
**Source code:** :source:`Lib/asynchat.py`
|
||||||
|
|
||||||
|
.. deprecated:: 3.6
|
||||||
|
Please use :mod:`asyncio` instead.
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
|
|
||||||
**Source code:** :source:`Lib/asyncore.py`
|
**Source code:** :source:`Lib/asyncore.py`
|
||||||
|
|
||||||
|
.. deprecated:: 3.6
|
||||||
|
Please use :mod:`asyncio` instead.
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
|
@ -46,8 +46,13 @@ method) up to the terminator, and then control will be returned to
|
||||||
you - by calling your self.found_terminator() method.
|
you - by calling your self.found_terminator() method.
|
||||||
"""
|
"""
|
||||||
import asyncore
|
import asyncore
|
||||||
|
import warnings
|
||||||
|
|
||||||
from collections import deque
|
from collections import deque
|
||||||
|
|
||||||
|
warnings.warn(
|
||||||
|
'asynchat module is deprecated in 3.6. Use asyncio instead.',
|
||||||
|
PendingDeprecationWarning, stacklevel=2)
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -60,6 +60,10 @@ from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
|
||||||
_DISCONNECTED = frozenset({ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE,
|
_DISCONNECTED = frozenset({ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE,
|
||||||
EBADF})
|
EBADF})
|
||||||
|
|
||||||
|
warnings.warn(
|
||||||
|
'asyncore module is deprecated in 3.6. Use asyncio instead.',
|
||||||
|
PendingDeprecationWarning, stacklevel=2)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
socket_map
|
socket_map
|
||||||
except NameError:
|
except NameError:
|
||||||
|
|
Loading…
Reference in New Issue