Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1:/tmp/cvs-serv27411/win32/src
Modified Files:
win32gui.i
Log Message:
When raising a TypeError for a handle, include in the message the type
of the object.
Index: win32gui.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** win32gui.i 15 Oct 2003 04:22:03 -0000 1.31
--- win32gui.i 20 Jan 2004 01:20:14 -0000 1.32
***************
*** 916,921 ****
$target = (LPTSTR) PyInt_AsLong($source);
else {
! PyErr_SetString(PyExc_TypeError, "Must pass an integer or a string");
! return NULL;
}
}
--- 916,922 ----
$target = (LPTSTR) PyInt_AsLong($source);
else {
! return PyErr_Format(PyExc_TypeError,
! "Must pass an integer or a string (got '%s')",
! $source->ob_type->tp_name);
}
}
***************
*** 1003,1008 ****
default:
if (!PyInt_Check(ob)) {
! PyErr_SetString(PyExc_TypeError, "object must be an integer");
! return NULL;
}
l = PyInt_AsLong(ob);
--- 1004,1010 ----
default:
if (!PyInt_Check(ob)) {
! return PyErr_Format(PyExc_TypeError,
! "object must be an integer (got '%s')",
! ob->ob_type->tp_name);
}
l = PyInt_AsLong(ob);
|