Improved error message. Contributed by Zooka.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4964 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
af81134fde
commit
b5b4699cde
1 changed files with 4 additions and 4 deletions
|
|
@ -276,8 +276,8 @@ cobject:
|
||||||
type_error:
|
type_error:
|
||||||
if (flags & SWIG_POINTER_EXCEPTION) {
|
if (flags & SWIG_POINTER_EXCEPTION) {
|
||||||
if (ty) {
|
if (ty) {
|
||||||
char *temp = (char *) malloc(64+strlen(ty->name));
|
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
|
||||||
sprintf(temp,"Type error. Expected %s", ty->name);
|
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
||||||
PyErr_SetString(PyExc_TypeError, temp);
|
PyErr_SetString(PyExc_TypeError, temp);
|
||||||
free((char *) temp);
|
free((char *) temp);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -309,8 +309,8 @@ type_error:
|
||||||
|
|
||||||
if (flags) {
|
if (flags) {
|
||||||
if (ty) {
|
if (ty) {
|
||||||
char *temp = (char *) malloc(64+strlen(ty->name));
|
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
|
||||||
sprintf(temp,"Type error. Expected %s", ty->name);
|
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
||||||
PyErr_SetString(PyExc_TypeError, temp);
|
PyErr_SetString(PyExc_TypeError, temp);
|
||||||
free((char *) temp);
|
free((char *) temp);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue