Improved error message. Contributed by Zooka.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4964 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b5b115f451
commit
13142e8184
1 changed files with 4 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue