Replace deprecation warning with RuntimeError (GH-14397)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user