summaryrefslogtreecommitdiff
path: root/Lib/asyncio/streams.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2019-06-27 14:38:47 +0300
committerGitHub <noreply@github.com>2019-06-27 14:38:47 +0300
commit97d15b1ee06ce80c4dbda91fb538a89bbcb2bed9 (patch)
tree1b91bb67d4e16e5da39c9bd0f59d38020748049c /Lib/asyncio/streams.py
parent667eaffb4e5d03bf8129773f79649c3befaa5b1a (diff)
downloadcpython-git-97d15b1ee06ce80c4dbda91fb538a89bbcb2bed9.tar.gz
Replace deprecation warning with RuntimeError (GH-14397)
Diffstat (limited to 'Lib/asyncio/streams.py')
-rw-r--r--Lib/asyncio/streams.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py
index f03441b6b1..204eaf7394 100644
--- a/Lib/asyncio/streams.py
+++ b/Lib/asyncio/streams.py
@@ -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