擅长:python、mysql、java
<p><a href="http://docs.python.org/library/sys.html#sys.exc_info" rel="nofollow noreferrer">sys.exc_info()</a></p>
<blockquote>
<p>This function returns a tuple of three values that give information
about the exception that is currently being handled. (...) If no
exception is being handled anywhere on the stack, a tuple containing
three None values is returned.</p>
</blockquote>
<p>另请参见以下问题:</p>
<p><a href="https://stackoverflow.com/q/9403986/95735">Python 3 traceback fails when no exception is active</a><br/>
<a href="https://stackoverflow.com/q/6278426/95735">Raising exceptions when an exception is already present in Python 3</a></p>