Commit 9d20676
fix: remove return from finally block to prevent exception swallowing (#2109)
The `get_log_path` function had a `return` statement inside a `finally`
block, which silently swallows any in-flight exceptions including
`BaseException` subclasses like `KeyboardInterrupt`.
Replace the `try/finally` with a proper `try/except` that catches the
expected `ValueError` (from `list.index()`) and `IndexError` (from
accessing the next argument), then move the directory creation and
return statement outside the exception handler.
Fixes #1731
Co-authored-by: Itamar Hartstein <haritamar@gmail.com>1 parent b5e41fe commit 9d20676
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
0 commit comments