Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
Commite480985
committed
Tweak rollback logic in log.to_file
This modifies the exception handling in log.to_file so it catchesBaseException rather than Exception and rolls back. Ordinarily wedo not want to catch BaseException, since this means catchingthings like SystemExit, KeyboardInterupt, etc., but the other casesof rolling back with LockedFD do it that strongly (both before whentry-finally was used with a flag, and now with try-except catchingBaseException to roll back the temporary-file write and reraise).Having this behave subtly different does not appear intentional.(This is also closer to what will happen if LockedFD becomes acontext manager and these pieces of code use it in awith-statement: even exceptions not inheriting from Exception willcause __exit__ to be called.)1 parentff84b26 commite480985
1 file changed
+1
-2
lines changedLines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
262 | 262 |
| |
263 | 263 |
| |
264 | 264 |
| |
265 |
| - | |
266 |
| - | |
| 265 | + | |
267 | 266 |
| |
268 | 267 |
| |
269 | 268 |
| |
|
0 commit comments
Comments
(0)