mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-12 07:09:19 +03:00
11 lines
210 B
Python
11 lines
210 B
Python
"""Async cancellation helpers."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import asyncio
|
|
|
|
|
|
def task_is_cancelling() -> bool:
|
|
task = asyncio.current_task()
|
|
return task is not None and task.cancelling() > 0
|