]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
* Python/errors.c (err_clear): clear interpreter stack trace
authorGuido van Rossum <guido@python.org>
Thu, 29 Sep 1994 09:39:39 +0000 (09:39 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 29 Sep 1994 09:39:39 +0000 (09:39 +0000)
Python/errors.c

index f339bbf6c7bda0580da888eeed057f9dee27d566..7266ecac6b80baed2497a2b4e776878c1941155b 100644 (file)
@@ -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 */