File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -401,21 +401,21 @@ def isgeneratorfunction(obj):
401
401
return _has_code_flag (obj , CO_GENERATOR )
402
402
403
403
# A marker for markcoroutinefunction and iscoroutinefunction.
404
- _is_coroutine_marker = object ()
404
+ _is_coroutine_mark = object ()
405
405
406
406
def _has_coroutine_mark (f ):
407
407
while ismethod (f ):
408
408
f = f .__func__
409
409
f = functools ._unwrap_partial (f )
410
- return getattr (f , "_is_coroutine_marker" , None ) is _is_coroutine_marker
410
+ return getattr (f , "_is_coroutine_marker" , None ) is _is_coroutine_mark
411
411
412
412
def markcoroutinefunction (func ):
413
413
"""
414
414
Decorator to ensure callable is recognised as a coroutine function.
415
415
"""
416
416
if hasattr (func , '__func__' ):
417
417
func = func .__func__
418
- func ._is_coroutine_marker = _is_coroutine_marker
418
+ func ._is_coroutine_marker = _is_coroutine_mark
419
419
return func
420
420
421
421
def iscoroutinefunction (obj ):
Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ def test_iscoroutine(self):
199
199
inspect .iscoroutinefunction (
200
200
functools .partial (functools .partial (
201
201
gen_coroutine_function_example ))))
202
+ self .assertFalse (inspect .iscoroutinefunction (inspect ))
202
203
self .assertFalse (inspect .iscoroutine (gen_coro ))
203
204
204
205
self .assertTrue (
You can’t perform that action at this time.
0 commit comments