@@ -393,15 +393,15 @@ def isgeneratorfunction(obj):
393
393
return _has_code_flag (obj , CO_GENERATOR )
394
394
395
395
# A marker for markcoroutinefunction and iscoroutinefunction.
396
- _is_coroutine = object ()
396
+ _is_coroutine_marker = object ()
397
397
398
398
def markcoroutinefunction (func ):
399
399
"""
400
400
Decorator to ensure callable is recognised as a coroutine function.
401
401
"""
402
402
if hasattr (func , '__func__' ):
403
403
func = func .__func__
404
- func ._is_coroutine = _is_coroutine
404
+ func ._is_coroutine_marker = _is_coroutine_marker
405
405
return func
406
406
407
407
def iscoroutinefunction (obj ):
@@ -412,10 +412,10 @@ def iscoroutinefunction(obj):
412
412
"""
413
413
if not isclass (obj ) and callable (obj ):
414
414
# Test both the function and the __call__ implementation for the
415
- # _is_coroutine marker .
416
- f = getattr (getattr (obj , "__func__" , obj ), "_is_coroutine " , None )
417
- c = getattr (obj .__call__ , "_is_coroutine " , None )
418
- if f is _is_coroutine or c is _is_coroutine :
415
+ # _is_coroutine_marker .
416
+ f = getattr (getattr (obj , "__func__" , obj ), "_is_coroutine_marker " , None )
417
+ c = getattr (obj .__call__ , "_is_coroutine_marker " , None )
418
+ if f is _is_coroutine_marker or c is _is_coroutine_marker :
419
419
return True
420
420
421
421
return _has_code_flag (obj , CO_COROUTINE ) or (
0 commit comments