Commit f499184
cacheprovider: simplify _make_cachedir cleanup with finally
Use a single finally block instead of duplicating cleanup logic in
separate except blocks. The finally block always runs, ensuring cleanup
whether the operation succeeds (rename moves dir away, rmtree is no-op),
fails with a race condition (ENOTEMPTY/EEXIST), or any other exception.
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4.5 <claude@anthropic.com>1 parent 841fe47 commit f499184
1 file changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
| 85 | + | |
87 | 86 | | |
88 | | - | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
| |||
0 commit comments