commit | ab7bf2143e67ddc1510413fa0d7f9c621adf22fa | [log] [tgz] |
---|---|---|
author | Nick Coghlan <ncoghlan@gmail.com> | Sun Feb 26 17:49:52 2012 +1000 |
committer | Nick Coghlan <ncoghlan@gmail.com> | Sun Feb 26 17:49:52 2012 +1000 |
tree | 62a24ed4f57e4db638ebde745bb83e2e09fc86e3 | |
parent | cda6b6d60d96e6f755da92deb5e4066839095791 [diff] [blame] |
Close issue #6210: Implement PEP 409
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index a642c0b..f4e7e7b 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c
@@ -1698,7 +1698,11 @@ 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();