Index: generic/tclVar.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclVar.c,v
retrieving revision 1.69.2.6
diff -u -r1.69.2.6 tclVar.c
--- generic/tclVar.c	16 Aug 2004 14:18:26 -0000	1.69.2.6
+++ generic/tclVar.c	30 Sep 2004 20:30:01 -0000
@@ -4133,6 +4133,7 @@
     int copiedName;
     int code = TCL_OK;
     int disposeFlags = 0;
+    int saveErrFlags = iPtr->flags;
 
     /*
      * If there are already similar trace procedures active for the
@@ -4255,6 +4256,9 @@
      */
 
     done:
+    if (code == TCL_OK) {
+	iPtr->flags = saveErrFlags;
+    }
     if (code == TCL_ERROR) {
 	if (leaveErrMsg) {
 	    CONST char *type = "";
Index: tests/var.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/var.test,v
retrieving revision 1.20.2.2
diff -u -r1.20.2.2 var.test
--- tests/var.test	12 May 2003 17:31:51 -0000	1.20.2.2
+++ tests/var.test	30 Sep 2004 20:30:02 -0000
@@ -694,6 +694,13 @@
     namespace eval test unset useSomeUnlikelyNameHere
 } {}
 
+test var-16.1 {CallVarTraces: save/restore interp error state} {
+    trace add variable errorCode write { ;#}
+    catch {error foo bar baz}
+    trace remove variable errorCode write { ;#}
+    set errorInfo
+} bar
+
 catch {namespace delete ns}
 catch {unset arr}
 catch {unset v}
