diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2019-09-12 15:40:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-12 15:40:40 +0300 |
commit | a488879cbaf4b8b52699cadccf73bb4c271bcb29 (patch) | |
tree | de6a1f6a029e3572ea749e6fe81bc461bf0c1732 /Lib/asyncio/subprocess.py | |
parent | 3ab61473ba7f3dca32d779ec2766a4faa0657923 (diff) | |
download | cpython-git-a488879cbaf4b8b52699cadccf73bb4c271bcb29.tar.gz |
bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033)
Diffstat (limited to 'Lib/asyncio/subprocess.py')
-rw-r--r-- | Lib/asyncio/subprocess.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py index e4f9e5297a..bddfb01464 100644 --- a/Lib/asyncio/subprocess.py +++ b/Lib/asyncio/subprocess.py @@ -224,6 +224,13 @@ async def create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, **kwds): if loop is None: loop = events.get_event_loop() + else: + warnings.warn("The loop argument is deprecated since Python 3.8 " + "and scheduled for removal in Python 3.10.", + DeprecationWarning, + stacklevel=2 + ) + protocol_factory = lambda: SubprocessStreamProtocol(limit=limit, loop=loop, _asyncio_internal=True) @@ -239,6 +246,12 @@ async def create_subprocess_exec(program, *args, stdin=None, stdout=None, limit=streams._DEFAULT_LIMIT, **kwds): if loop is None: loop = events.get_event_loop() + else: + warnings.warn("The loop argument is deprecated since Python 3.8 " + "and scheduled for removal in Python 3.10.", + DeprecationWarning, + stacklevel=2 + ) protocol_factory = lambda: SubprocessStreamProtocol(limit=limit, loop=loop, _asyncio_internal=True) |