- commit
- a019ed45d9adcf70bdfd65911acf3cdf8d1be129
- parent
- f6bb96e25ebc47d8f800c7a57ef4bde656377094
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2025-02-02 14:49
typos
Diffstat
M | _content/posts/2023-01-29-python-async-loops/index.md | 2 | +- |
M | _content/posts/2023-03-30-tui/index.md | 4 | ++-- |
2 files changed, 3 insertions, 3 deletions
diff --git a/_content/posts/2023-01-29-python-async-loops/index.md b/_content/posts/2023-01-29-python-async-loops/index.md
@@ -978,7 +978,7 @@ loop.run_forever() 978 978 ``` 979 979 980 980 When we call `task.wakeup()`, the coroutine `amain()` starts executing. It981 -1 prints `'foo'`, creates a future, and tells the loop to resolve that future in-1 981 prints `'start'`, creates a future, and tells the loop to resolve that future in 982 982 5 seconds. Then it yields that future back down to `wakeup()`, which registeres 983 983 itself as a callback on the future. Now the loop starts running, waits for 5 984 984 seconds, and then resolves the future. Because `wakeup()` was added as a
diff --git a/_content/posts/2023-03-30-tui/index.md b/_content/posts/2023-03-30-tui/index.md
@@ -102,7 +102,7 @@ exit_tui() 102 102 ## Handling exceptions 103 103 104 104 The above code still has a major issue: When our mainloop raises an exception,105 -1 the process ends without exiting TUI mode, so we end up with broken terminal.-1 105 the process ends without exiting TUI mode, so we end up with a broken terminal. 106 106 The fix in this case is simple though: Wrap the code in a `try … finally` block 107 107 so the cleanup code is run even if there are exceptions. 108 108 @@ -125,7 +125,7 @@ Signals can interrupt our code at any time, e.g. in the middle of writing a 125 125 string to stdout. There are very few operations that are safe to run in a 126 126 signal handler. It is therefore crucial that you integrate the signal handler 127 127 with your mainloop, e.g. using the [self-pipe128 -1 trick](https://cr.yp.to/docs/selfpipe.html). I am going into the details in-1 128 trick](https://cr.yp.to/docs/selfpipe.html). I am not going into the details in 129 129 this article and instead assume that you have dealt with that yourself. 130 130 131 131 The code we need to run on `SIGTSTP` should look something like this: