Index: generic/tclBasic.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v
retrieving revision 1.75.2.7
diff -u -r1.75.2.7 tclBasic.c
--- generic/tclBasic.c	3 Oct 2003 20:31:23 -0000	1.75.2.7
+++ generic/tclBasic.c	8 Oct 2003 23:04:14 -0000
@@ -3095,6 +3095,8 @@
      * Call 'leave' command traces
      */
     if (!(cmdPtr->flags & CMD_IS_DELETED)) {
+	int saveErrFlags = iPtr->flags 
+		& (ERR_IN_PROGRESS | ERR_ALREADY_LOGGED | ERROR_CODE_SET);
         if ((cmdPtr->flags & CMD_HAS_EXEC_TRACES) && (traceCode == TCL_OK)) {
             traceCode = TclCheckExecutionTraces (interp, command, length,
                    cmdPtr, code, TCL_TRACE_LEAVE_EXEC, objc, objv);
@@ -3103,6 +3105,9 @@
             traceCode = TclCheckInterpTraces(interp, command, length,
                    cmdPtr, code, TCL_TRACE_LEAVE_EXEC, objc, objv);
         }
+	if (traceCode == TCL_OK) {
+	    iPtr->flags |= saveErrFlags;
+	}
     }
     TclCleanupCommand(cmdPtr);
 
