summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-02-26 17:49:52 +1000
committerNick Coghlan <ncoghlan@gmail.com>2012-02-26 17:49:52 +1000
commitfc7f17dd7a77350fd6906e2082f2375647b57c6a (patch)
tree7df2ed7b2d7d28251004c146ec58794e7f4578d5 /Python/pythonrun.c
parentabd66a1487dcadc26eaeb733cd252059e9ae98c1 (diff)
downloadcpython-fc7f17dd7a77350fd6906e2082f2375647b57c6a.tar.gz
Close issue #6210: Implement PEP 409
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c6
1 files changed, 5 insertions, 1 deletions
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();