summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-28 23:06:57 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-28 23:06:57 (GMT)
commit98e2b452975f13b13052aeb9d166ed8a3ef45063 (patch)
tree2d7ee32804bc590346f62f45bcb1e46b0221f90b /Python
parentd7a3ab962bb773258ad1906c26af1ca75ed7daf7 (diff)
downloadcpython-98e2b452975f13b13052aeb9d166ed8a3ef45063.zip
cpython-98e2b452975f13b13052aeb9d166ed8a3ef45063.tar.gz
cpython-98e2b452975f13b13052aeb9d166ed8a3ef45063.tar.bz2
Merged revisions 85896 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85896 | antoine.pitrou | 2010-10-29 00:56:58 +0200 (ven., 29 oct. 2010) | 4 lines Issue #5437: A preallocated MemoryError instance should not hold traceback data (including local variables caught in the stack trace) alive infinitely. ........
Diffstat (limited to 'Python')
-rw-r--r--Python/errors.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 4584205..db0baf1 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -328,29 +328,7 @@ PyErr_BadArgument(void)
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)
- {
- /* Clear the previous traceback, otherwise it will be appended
- * to the current one.
- *
- * The following statement is not likely to raise any error;
- * if it does, we simply discard it.
- */
- PyException_SetTraceback(PyExc_MemoryErrorInst, Py_None);
-
- PyErr_SetObject(PyExc_MemoryError, PyExc_MemoryErrorInst);
- }
- else
- /* this will probably fail since there's no memory and hee,
- hee, we have to instantiate this class
- */
- PyErr_SetNone(PyExc_MemoryError);
-
+ PyErr_SetNone(PyExc_MemoryError);
return NULL;
}