We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adb5db6 commit 617688eCopy full SHA for 617688e
Lib/asyncio/coroutines.py
@@ -107,12 +107,14 @@ def coroutine(func):
107
If the coroutine is not yielded from before it is destroyed,
108
an error message is logged.
109
"""
110
- if inspect.iscoroutinefunction(func):
+ if (inspect.iscoroutinefunction(func)
111
+ and not isinstance(func, functools.partial)):
112
# In Python 3.5 that's all we need to do for coroutines
113
# defined with "async def".
114
return func
115
- if inspect.isgeneratorfunction(func):
116
+ if (inspect.isgeneratorfunction(func)
117
+ and not isinstance (func, functools.partial)):
118
coro = func
119
else:
120
@functools.wraps(func)
0 commit comments