mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)
See https://bugs.python.org/issue38242 for more details
This commit is contained in:
parent
3667e1ee6c
commit
6758e6e12a
13 changed files with 381 additions and 2755 deletions
|
|
@ -3,7 +3,6 @@
|
|||
# flake8: noqa
|
||||
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
# This relies on each of the submodules having an __all__ variable.
|
||||
from .base_events import *
|
||||
|
|
@ -44,40 +43,3 @@ if sys.platform == 'win32': # pragma: no cover
|
|||
else:
|
||||
from .unix_events import * # pragma: no cover
|
||||
__all__ += unix_events.__all__
|
||||
|
||||
|
||||
__all__ += ('StreamReader', 'StreamWriter', 'StreamReaderProtocol') # deprecated
|
||||
|
||||
|
||||
def __getattr__(name):
|
||||
global StreamReader, StreamWriter, StreamReaderProtocol
|
||||
if name == 'StreamReader':
|
||||
warnings.warn("StreamReader is deprecated since Python 3.8 "
|
||||
"in favor of Stream, and scheduled for removal "
|
||||
"in Python 3.10",
|
||||
DeprecationWarning,
|
||||
stacklevel=2)
|
||||
from .streams import StreamReader as sr
|
||||
StreamReader = sr
|
||||
return StreamReader
|
||||
if name == 'StreamWriter':
|
||||
warnings.warn("StreamWriter is deprecated since Python 3.8 "
|
||||
"in favor of Stream, and scheduled for removal "
|
||||
"in Python 3.10",
|
||||
DeprecationWarning,
|
||||
stacklevel=2)
|
||||
from .streams import StreamWriter as sw
|
||||
StreamWriter = sw
|
||||
return StreamWriter
|
||||
if name == 'StreamReaderProtocol':
|
||||
warnings.warn("Using asyncio internal class StreamReaderProtocol "
|
||||
"is deprecated since Python 3.8 "
|
||||
" and scheduled for removal "
|
||||
"in Python 3.10",
|
||||
DeprecationWarning,
|
||||
stacklevel=2)
|
||||
from .streams import StreamReaderProtocol as srp
|
||||
StreamReaderProtocol = srp
|
||||
return StreamReaderProtocol
|
||||
|
||||
raise AttributeError(f"module {__name__} has no attribute {name}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue