MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / is_tornado_coroutine

Function is_tornado_coroutine

cloudpickle/cloudpickle.py:451–468  ·  view source on GitHub ↗

Return whether `func` is a Tornado coroutine function. Running coroutines are not supported.

(func)

Source from the content-addressed store, hash-verified

449
450
451def is_tornado_coroutine(func):
452 """Return whether `func` is a Tornado coroutine function.
453
454 Running coroutines are not supported.
455 """
456 warnings.warn(
457 "is_tornado_coroutine is deprecated in cloudpickle 3.0 and will be "
458 "removed in cloudpickle 4.0. Use tornado.gen.is_coroutine_function "
459 "directly instead.",
460 category=DeprecationWarning,
461 )
462 if "tornado.gen" not in sys.modules:
463 return False
464 gen = sys.modules["tornado.gen"]
465 if not hasattr(gen, "is_coroutine_function"):
466 # Tornado version is too old
467 return False
468 return gen.is_coroutine_function(func)
469
470
471def subimport(name):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected