mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
* Python/errors.c (err_clear): clear interpreter stack trace
This commit is contained in:
parent
83dd6c319e
commit
6989e54ebf
1 changed files with 5 additions and 1 deletions
|
@ -56,7 +56,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
*/
|
||||
|
||||
#include "allobjects.h"
|
||||
#include "modsupport.h"
|
||||
#include "traceback.h"
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -119,10 +119,14 @@ err_get(p_exc, p_val)
|
|||
void
|
||||
err_clear()
|
||||
{
|
||||
object *tb;
|
||||
XDECREF(last_exception);
|
||||
last_exception = NULL;
|
||||
XDECREF(last_exc_val);
|
||||
last_exc_val = NULL;
|
||||
/* Also clear interpreter stack trace */
|
||||
tb = tb_fetch();
|
||||
XDECREF(tb);
|
||||
}
|
||||
|
||||
/* Convenience functions to set a type error exception and return 0 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue