Skip to content

Commit 5c5e6ba

Browse files
committed
DRIVERS.md notes on cancellation and result retrieval. TUTORIAL improve 5.2.
1 parent 23bd05b commit 5c5e6ba

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

v3/docs/DRIVERS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,3 +641,5 @@ try:
641641
finally:
642642
_ = asyncio.new_event_loop()
643643
```
644+
645+
###### [Contents](./DRIVERS.md#1-contents)

v3/docs/TUTORIAL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ at that point, whether or not the cancelled task is scheduled for execution: a
16701670
task waiting on (say) an `Event` or a `sleep` will be cancelled.
16711671

16721672
For tasks launched with `.create_task` the exception is transparent to the
1673-
user: the task simply stops when next scheduled. It is possible to trap the
1673+
user: the task simply stops as described above. It is possible to trap the
16741674
exception, for example to perform cleanup code, typically in a `finally`
16751675
clause. The exception thrown to the task is `uasyncio.CancelledError` in both
16761676
cancellation and timeout. There is no way for the task to distinguish between
@@ -1679,8 +1679,8 @@ these two cases.
16791679
As stated above, for a task launched with `.create_task` trapping the error is
16801680
optional. Where a task is `await`ed, to avoid a halt it must be trapped within
16811681
the task, within the `await`ing scope, or both. In the last case the task must
1682-
re-raise it after trapping so that the exception can again be trapped in the
1683-
outer scope.
1682+
re-raise the exception after trapping so that the error can again be trapped in
1683+
the outer scope.
16841684

16851685
## 5.2.1 Task cancellation
16861686

0 commit comments

Comments
 (0)