From: Guido van Rossum Date: Tue, 25 Oct 2016 15:49:13 +0000 (-0700) Subject: Issue 25002: Deprecate asyncore/asynchat. Patch by Mariatta. X-Git-Tag: v3.6.0b3~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16591f440d650f77c841a3245785e2423a50249f;p=thirdparty%2FPython%2Fcpython.git Issue 25002: Deprecate asyncore/asynchat. Patch by Mariatta. --- diff --git a/Doc/library/asynchat.rst b/Doc/library/asynchat.rst index e02360c883cc..9e51416b83a5 100644 --- a/Doc/library/asynchat.rst +++ b/Doc/library/asynchat.rst @@ -9,6 +9,9 @@ **Source code:** :source:`Lib/asynchat.py` +.. deprecated:: 3.6 + Please use :mod:`asyncio` instead. + -------------- .. note:: diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index c838be7fd5e1..11d36163e44a 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -12,6 +12,9 @@ **Source code:** :source:`Lib/asyncore.py` +.. deprecated:: 3.6 + Please use :mod:`asyncio` instead. + -------------- .. note:: diff --git a/Lib/asynchat.py b/Lib/asynchat.py index fc1146adbb10..fede592126b9 100644 --- a/Lib/asynchat.py +++ b/Lib/asynchat.py @@ -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 diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 705e40681303..f17b31ad40e4 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -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: