Catching MemoryError exception on malware upload