Uh oh!
There was an error while loading. Please reload this page.
Ignore AttributeError when deleting temporary audio buffers - #622
Conversation
Can we do the same thing with the following? Not sure if there's a need to import contextlib here. |
mgeier
commented
Jan 23, 2026
No: You could do something like
It's not strictly necessary, we could also just use It's also not strictly necessary to rely on catching exceptions at all (which is called "it's easier to ask for forgiveness than permission"), but instead check first whether the instance variables are defined or not (which is called "look before you leap"). There are many choices, and it's mostly a matter of taste. |
Uh oh!
There was an error while loading. Please reload this page.
mgeier
commented
Jan 23, 2026
I'm merging this to avoid too many people tripping over this problem, but if you @jared-v-hoyt have (or anybody else has) any ideas for improvements, we can of course do them afterwards. PRs are welcome! |
Pure input/output streams only use one of
data/outrespectively, so we have to take care whether they even exist before we delete them.Fixes#621.