lisa-lab/pylearn2 — pull request #935 by bouthilx (2014-05-29 17:08:25+00:00)
Title: Add wrapping function to improve MemoryError message

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.