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 @@ -403,21 +403,21 @@ def isgeneratorfunction(obj):
403403 return _has_code_flag (obj , CO_GENERATOR )
404404
405405# A marker for markcoroutinefunction and iscoroutinefunction.
406- _is_coroutine_marker = object ()
406+ _is_coroutine_mark = object ()
407407
408408def _has_coroutine_mark (f ):
409409 while ismethod (f ):
410410 f = f .__func__
411411 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
413413
414414def markcoroutinefunction (func ):
415415 """
416416 Decorator to ensure callable is recognised as a coroutine function.
417417 """
418418 if hasattr (func , '__func__' ):
419419 func = func .__func__
420- func ._is_coroutine_marker = _is_coroutine_marker
420+ func ._is_coroutine_marker = _is_coroutine_mark
421421 return func
422422
423423def iscoroutinefunction (obj ):
Original file line number Diff line number Diff line change @@ -235,6 +235,7 @@ class PMClass:
235235 gen_coroutine_function_example ))))
236236 self .assertFalse (inspect .iscoroutinefunction (gen_coro_pmi ))
237237 self .assertFalse (inspect .iscoroutinefunction (gen_coro_pmc ))
238+ self .assertFalse (inspect .iscoroutinefunction (inspect ))
238239 self .assertFalse (inspect .iscoroutine (gen_coro ))
239240
240241 self .assertTrue (
You can’t perform that action at this time.
0 commit comments