mirror of
https://github.com/python/cpython.git
synced 2025-09-25 01:43:11 +00:00
Replace deprecation warning with RuntimeError (GH-14397)
(cherry picked from commit 97d15b1ee0
)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
This commit is contained in:
parent
7e9d706fd6
commit
4cbe7a3ce4
2 changed files with 8 additions and 4 deletions
|
@ -1293,10 +1293,8 @@ class Stream:
|
|||
is_server_side=False,
|
||||
_asyncio_internal=False):
|
||||
if not _asyncio_internal:
|
||||
warnings.warn(f"{self.__class__} should be instaniated "
|
||||
"by asyncio internals only, "
|
||||
"please avoid its creation from user code",
|
||||
DeprecationWarning)
|
||||
raise RuntimeError(f"{self.__class__} should be instantiated "
|
||||
"by asyncio internals only")
|
||||
self._mode = mode
|
||||
self._transport = transport
|
||||
self._protocol = protocol
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue