Skip to content

Commit caddd21

Browse files
committed
Change test that checks __reprl__ of partial
1 parent 617688e commit caddd21

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Lib/asyncio/coroutines.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,12 @@ def coroutine(func):
107107
If the coroutine is not yielded from before it is destroyed,
108108
an error message is logged.
109109
"""
110-
if (inspect.iscoroutinefunction(func)
111-
and not isinstance(func, functools.partial)):
110+
if inspect.iscoroutinefunction(func):
112111
# In Python 3.5 that's all we need to do for coroutines
113112
# defined with "async def".
114113
return func
115114

116-
if (inspect.isgeneratorfunction(func)
117-
and not isinstance (func, functools.partial)):
115+
if inspect.isgeneratorfunction(func):
118116
coro = func
119117
else:
120118
@functools.wraps(func)

Lib/test/test_asyncio/test_tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ async def func(x, y):
440440

441441
coro_repr = repr(task._coro)
442442
expected = (
443-
r'<CoroWrapper \w+.test_task_repr_partial_corowrapper'
444-
r'\.<locals>\.func\(1\)\(\) running, '
443+
r'<coroutine object \w+\.test_task_repr_partial_corowrapper'
444+
r'\.<locals>\.func at'
445445
)
446446
self.assertRegex(coro_repr, expected)
447447

0 commit comments

Comments
 (0)