Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c073cf7

Browse files
committedDec 13, 2022
Renamed to _is_coroutine_marker.
1 parent 3bc72e2 commit c073cf7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎Lib/inspect.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -393,15 +393,15 @@ def isgeneratorfunction(obj):
393393
return _has_code_flag(obj, CO_GENERATOR)
394394

395395
# A marker for markcoroutinefunction and iscoroutinefunction.
396-
_is_coroutine = object()
396+
_is_coroutine_marker = object()
397397

398398
def markcoroutinefunction(func):
399399
"""
400400
Decorator to ensure callable is recognised as a coroutine function.
401401
"""
402402
if hasattr(func, '__func__'):
403403
func = func.__func__
404-
func._is_coroutine = _is_coroutine
404+
func._is_coroutine_marker = _is_coroutine_marker
405405
return func
406406

407407
def iscoroutinefunction(obj):
@@ -412,10 +412,10 @@ def iscoroutinefunction(obj):
412412
"""
413413
if not isclass(obj) and callable(obj):
414414
# 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:
419419
return True
420420

421421
return _has_code_flag(obj, CO_COROUTINE) or (

0 commit comments

Comments
 (0)
Please sign in to comment.