lisa-lab/pylearn2 — pull request #936 by bouthilx (2014-05-29 17:51:41+00:00)
Title: Wraps MemoryError to improve message if empty

Fix issue #934

MemoryError message is often empty but not always. Catching MemoryError and raising TypicalMemoryError hides some specific MemoryError message.

This PR adds a wrapping function `improve_memory_error_message` that raises a TypicalMemoryError only if the MemoryError message is empty.