File tree 2 files changed +4
-6
lines changed 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -107,14 +107,12 @@ def coroutine(func):
107
107
If the coroutine is not yielded from before it is destroyed,
108
108
an error message is logged.
109
109
"""
110
- if (inspect .iscoroutinefunction (func )
111
- and not isinstance (func , functools .partial )):
110
+ if inspect .iscoroutinefunction (func ):
112
111
# In Python 3.5 that's all we need to do for coroutines
113
112
# defined with "async def".
114
113
return func
115
114
116
- if (inspect .isgeneratorfunction (func )
117
- and not isinstance (func , functools .partial )):
115
+ if inspect .isgeneratorfunction (func ):
118
116
coro = func
119
117
else :
120
118
@functools .wraps (func )
Original file line number Diff line number Diff line change @@ -440,8 +440,8 @@ async def func(x, y):
440
440
441
441
coro_repr = repr (task ._coro )
442
442
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 '
445
445
)
446
446
self .assertRegex (coro_repr , expected )
447
447
You can’t perform that action at this time.
0 commit comments