mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-43216: Remove @asyncio.coroutine (GH-26369)
Remove the @asyncio.coroutine decorator enabling legacy generator-based coroutines to be compatible with async/await code; remove asyncio.coroutines.CoroWrapper used for wrapping legacy coroutine objects in the debug mode. The decorator has been deprecated since Python 3.8 and the removal was initially scheduled for Python 3.10.
This commit is contained in:
parent
3623aaa78c
commit
a1092f6249
11 changed files with 85 additions and 763 deletions
|
|
@ -17,6 +17,7 @@ import subprocess
|
|||
import sys
|
||||
import threading
|
||||
import time
|
||||
import types
|
||||
import errno
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
|
@ -2163,8 +2164,7 @@ class HandleTests(test_utils.TestCase):
|
|||
'<Handle cancelled>')
|
||||
|
||||
# decorated function
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
cb = asyncio.coroutine(noop)
|
||||
cb = types.coroutine(noop)
|
||||
h = asyncio.Handle(cb, (), self.loop)
|
||||
self.assertEqual(repr(h),
|
||||
'<Handle noop() at %s:%s>'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue