[Pyrex] PyErr_NoMemory

Grant McDonald gmcdonald at infocomp.com
Mon Jul 4 07:48:41 CEST 2005


Hi,

I just wanted to ask what the accepted way of indicating a memory allocation
error in Pyrex is? I have no trouble doing the following:

pstr = <char*>PyMem_Malloc(size)
if pstr == NULL:
    return PyErr_NoMemory()

But in the interpreter this doesn't give any information besides
"MemoryError". Is this standard practice or do you take the alternate path
of raising a python exception that encapsulates more contextual information?

Regards,

Grant M.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.copyleft.no/pipermail/pyrex/attachments/20050704/1ea5d9a4/attachment.html


More information about the Pyrex mailing list