From 13142e8184f69ebe66670eedc1db348da9ec53d9 Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Mon, 28 Jul 2003 22:04:15 +0000 Subject: [PATCH] Improved error message. Contributed by Zooka. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4964 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/python/pyrun.swg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index ef810aabd..c59a38a13 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -276,8 +276,8 @@ cobject: type_error: if (flags & SWIG_POINTER_EXCEPTION) { if (ty) { - char *temp = (char *) malloc(64+strlen(ty->name)); - sprintf(temp,"Type error. Expected %s", ty->name); + char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c)); + sprintf(temp,"Type error. Got %s, expected %s", c, ty->name); PyErr_SetString(PyExc_TypeError, temp); free((char *) temp); } else { @@ -309,8 +309,8 @@ type_error: if (flags) { if (ty) { - char *temp = (char *) malloc(64+strlen(ty->name)); - sprintf(temp,"Type error. Expected %s", ty->name); + char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c)); + sprintf(temp,"Type error. Got %s, expected %s", c, ty->name); PyErr_SetString(PyExc_TypeError, temp); free((char *) temp); } else {