[pywin32-checkins] pywin32/com/win32com/src PyIDispatch.cpp,1.10,1.11
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2006-02-13 01:17:15
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14139/win32com/src Modified Files: PyIDispatch.cpp Log Message: Replace trivial OleSetTypeError with PyErr_Format. Index: PyIDispatch.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIDispatch.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PyIDispatch.cpp 10 Jan 2006 00:49:43 -0000 1.10 --- PyIDispatch.cpp 13 Feb 2006 01:17:01 -0000 1.11 *************** *** 5,15 **** #include "PythonCOM.h" - // A little helper just for this file - static PyObject* OleSetTypeError(char *msg) - { - PyErr_SetString(PyExc_TypeError, msg); - return NULL; - } - static BOOL HandledDispatchFailure(HRESULT hr, EXCEPINFO *einfo, UINT nArgErr, UINT cArgs) { --- 5,8 ---- *************** *** 67,71 **** return NULL; if ( argc < 1 ) ! return OleSetTypeError("At least one argument must be supplied"); LCID lcid = LOCALE_SYSTEM_DEFAULT; --- 60,64 ---- return NULL; if ( argc < 1 ) ! return PyErr_Format(PyExc_TypeError, "At least one argument must be supplied"); LCID lcid = LOCALE_SYSTEM_DEFAULT; *************** *** 171,175 **** { if ( !PyErr_Occurred() ) ! OleSetTypeError("Bad argument"); while ( i-- > 0 ) VariantClear(&pParm->rgvarg[i]); --- 164,168 ---- { if ( !PyErr_Occurred() ) ! PyErr_Format(PyExc_TypeError, "Bad argument"); while ( i-- > 0 ) VariantClear(&pParm->rgvarg[i]); *************** *** 215,219 **** return NULL; if ( argc < 4 ) ! return OleSetTypeError("not enough arguments (at least 4 needed)"); // @pyparm int|dispid||The dispid to use. Typically this value will come from <om PyIDispatch.GetIDsOfNames> or from a type library. --- 208,212 ---- return NULL; if ( argc < 4 ) ! return PyErr_Format(PyExc_TypeError, "not enough arguments (at least 4 needed)"); // @pyparm int|dispid||The dispid to use. Typically this value will come from <om PyIDispatch.GetIDsOfNames> or from a type library. *************** *** 289,293 **** return NULL; if ( argc < 5 ) ! return OleSetTypeError("not enough arguments (at least 5 needed)"); // @pyparm int|dispid||The dispid to use. Please see <om PyIDispatch.Invoke>. --- 282,286 ---- return NULL; if ( argc < 5 ) ! return PyErr_Format(PyExc_TypeError, "not enough arguments (at least 5 needed)"); // @pyparm int|dispid||The dispid to use. Please see <om PyIDispatch.Invoke>. *************** *** 310,314 **** int argTypesLen = PyObject_Length(argsElemDescArray); if (!PyTuple_Check(argsElemDescArray) || argTypesLen<argc-5) ! return OleSetTypeError("The array of argument types must be a tuple whose size is <= to the number of arguments."); // See how many _real_ entries - count until end or // first param marked as Missing. --- 303,307 ---- int argTypesLen = PyObject_Length(argsElemDescArray); if (!PyTuple_Check(argsElemDescArray) || argTypesLen<argc-5) ! return PyErr_Format(PyExc_TypeError, "The array of argument types must be a tuple whose size is <= to the number of arguments."); // See how many _real_ entries - count until end or // first param marked as Missing. |