comparison Python/errors.c @ 14066:25eea88047e9 legacy-trunk

Do not set a MemoryError exception over another MemoryError exception, thus preserving the first one that has been raised.
author Vladimir Marangozov <vladimir.marangozov@t-online.de>
date Fri, 18 Aug 2000 18:01:06 +0000
parents 15ad4088a700
children 019265b3a856
comparison
equal deleted inserted replaced
14065:c50feffae822 14066:25eea88047e9
236 } 236 }
237 237
238 PyObject * 238 PyObject *
239 PyErr_NoMemory(void) 239 PyErr_NoMemory(void)
240 { 240 {
241 if (PyErr_ExceptionMatches(PyExc_MemoryError))
242 /* already current */
243 return NULL;
244
241 /* raise the pre-allocated instance if it still exists */ 245 /* raise the pre-allocated instance if it still exists */
242 if (PyExc_MemoryErrorInst) 246 if (PyExc_MemoryErrorInst)
243 PyErr_SetObject(PyExc_MemoryError, PyExc_MemoryErrorInst); 247 PyErr_SetObject(PyExc_MemoryError, PyExc_MemoryErrorInst);
244 else 248 else
245 /* this will probably fail since there's no memory and hee, 249 /* this will probably fail since there's no memory and hee,