 generic/tcldom.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/generic/tcldom.c b/generic/tcldom.c
index 91d98c9..0f024b3 100644
--- a/generic/tcldom.c
+++ b/generic/tcldom.c
@@ -5933,8 +5933,13 @@ int tcldom_EvalLocked (
     ret = Tcl_EvalObj(interp, objv[2]);
     if (ret == TCL_ERROR) {
         char msg[64 + TCL_INTEGER_SPACE];
+    #if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
         sprintf(msg, "\n    (\"%s %s\" body line %d)", Tcl_GetString(objv[0]),
                 Tcl_GetString(objv[1]), interp->errorLine);
+    #else
+        sprintf(msg, "\n    (\"%s %s\" body line %d)", Tcl_GetString(objv[0]),
+                Tcl_GetString(objv[1]), Tcl_GetErrorLine(interp));
+    #endif
         Tcl_AddErrorInfo(interp, msg);
     }
 
