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