From ab7bf2143e67ddc1510413fa0d7f9c621adf22fa Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Sun, 26 Feb 2012 17:49:52 +1000 Subject: Close issue #6210: Implement PEP 409 --- Python/pythonrun.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index a642c0b0da..f4e7e7b9b2 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1698,7 +1698,11 @@ print_exception_recursive(PyObject *f, PyObject *value, PyObject *seen) else if (PyExceptionInstance_Check(value)) { cause = PyException_GetCause(value); context = PyException_GetContext(value); - if (cause) { + if (cause && cause == Py_None) { + /* print neither cause nor context */ + ; + } + else if (cause) { res = PySet_Contains(seen, cause); if (res == -1) PyErr_Clear(); -- cgit v1.2.1