Mercurial > cpython-lru_cache-weakref
diff 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 |
line wrap: on
line diff
--- a/Python/errors.c Fri Aug 18 16:09:56 2000 +0000 +++ b/Python/errors.c Fri Aug 18 18:01:06 2000 +0000 @@ -238,6 +238,10 @@ PyObject * PyErr_NoMemory(void) { + if (PyErr_ExceptionMatches(PyExc_MemoryError)) + /* already current */ + return NULL; + /* raise the pre-allocated instance if it still exists */ if (PyExc_MemoryErrorInst) PyErr_SetObject(PyExc_MemoryError, PyExc_MemoryErrorInst);
