Return whether `func` is a Tornado coroutine function. Running coroutines are not supported.
(func)
| 449 | |
| 450 | |
| 451 | def 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 | |
| 471 | def subimport(name): |
nothing calls this directly
no outgoing calls
no test coverage detected