I believe what you’re seeing is the result of exception chaining, which is a change in Python 3.
From the Motivation section of the PEP:
During the handling of one exception (exception
A), it is possible that another exception (exceptionB) may occur. In today’s Python (version 2.4), if this happens, exceptionBis propagated outward and exceptionAis lost. In order to debug the problem, it is useful to know about both exceptions. The__context__attribute retains this information automatically.
The PEP then goes on to describe the new exception chaining (which is implemented in Py3k) in detail—it’s an interesting read. I learned something new today.