Is there a way to globally trap MemoryError exceptions so that a library can clear out caches instead of letting a MemoryError be seen by user code?
I\'m developing
A MemoryError is an exception, you should be able to catch it in an except block.
MemoryError
except