MCPcopy Index your code
hub / github.com/python/cpython / uncancel

Method uncancel

Lib/asyncio/tasks.py:233–245  ·  view source on GitHub ↗

Decrement the task's count of cancellation requests. This should be called by the party that called `cancel()` on the task beforehand. Returns the remaining number of cancellation requests.

(self)

Source from the content-addressed store, hash-verified

231 return self._num_cancels_requested
232
233 def uncancel(self):
234 """Decrement the task's count of cancellation requests.
235
236 This should be called by the party that called `cancel()` on the task
237 beforehand.
238
239 Returns the remaining number of cancellation requests.
240 """
241 if self._num_cancels_requested > 0:
242 self._num_cancels_requested -= 1
243 if self._num_cancels_requested == 0:
244 self._must_cancel = False
245 return self._num_cancels_requested
246
247 def __eager_start(self):
248 prev_task = _py_swap_current_task(self._loop, self)

Callers 6

_aexitMethod · 0.80
__aexit__Method · 0.80
taskMethod · 0.80
test_uncancel_basicMethod · 0.80

Calls

no outgoing calls

Tested by 4

taskMethod · 0.64
test_uncancel_basicMethod · 0.64