]> granicus.if.org Git - python/commitdiff
Issue 25002: Deprecate asyncore/asynchat. Patch by Mariatta.
authorGuido van Rossum <guido@python.org>
Tue, 25 Oct 2016 15:49:13 +0000 (08:49 -0700)
committerGuido van Rossum <guido@python.org>
Tue, 25 Oct 2016 15:49:13 +0000 (08:49 -0700)
Doc/library/asynchat.rst
Doc/library/asyncore.rst
Lib/asynchat.py
Lib/asyncore.py

index e02360c883cc86c9831c02dc661b3999cffb981b..9e51416b83a570b45964431e85ef8b07070b27f5 100644 (file)
@@ -9,6 +9,9 @@
 
 **Source code:** :source:`Lib/asynchat.py`
 
+.. deprecated:: 3.6
+   Please use :mod:`asyncio` instead.
+
 --------------
 
 .. note::
index c838be7fd5e11b2b9c5ba861f9eb6f5a551d5ccb..11d36163e44a790a48d4291fb5ce4f696984bbab 100644 (file)
@@ -12,6 +12,9 @@
 
 **Source code:** :source:`Lib/asyncore.py`
 
+.. deprecated:: 3.6
+   Please use :mod:`asyncio` instead.
+
 --------------
 
 .. note::
index fc1146adbb10dc5a8a3d0853afd83bdec9ecadb4..fede592126b964c036c41be231cfd587ef117d6b 100644 (file)
@@ -46,8 +46,13 @@ method) up to the terminator, and then control will be returned to
 you - by calling your self.found_terminator() method.
 """
 import asyncore
+import warnings
+
 from collections import deque
 
+warnings.warn(
+    'asynchat module is deprecated in 3.6. Use asyncio instead.',
+    PendingDeprecationWarning, stacklevel=2)
 
 class async_chat(asyncore.dispatcher):
     """This is an abstract class.  You must derive from this class, and add
index 705e40681303259f3f976cc72de9b2974d11c695..f17b31ad40e487a37b4ebc3b732b2866ae571315 100644 (file)
@@ -60,6 +60,10 @@ from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
 _DISCONNECTED = frozenset({ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE,
                            EBADF})
 
+warnings.warn(
+    'asyncore module is deprecated in 3.6. Use asyncio instead.',
+    PendingDeprecationWarning, stacklevel=2)
+
 try:
     socket_map
 except NameError: