[pywin32-checkins] pywin32/Pythonwin win32template.cpp,1.2,1.3 win32uiole.cpp,1.4,1.5
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-01-28 22:40:19
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13384 Modified Files: win32template.cpp win32uiole.cpp Log Message: * Inlcude the type of the object received when raising a TypeError. * Move to the new COM error functions. Index: win32uiole.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uiole.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32uiole.cpp 20 Jan 2004 22:27:16 -0000 1.4 --- win32uiole.cpp 28 Jan 2005 22:40:01 -0000 1.5 *************** *** 93,97 **** HRESULT hr = pEngine->QueryInterface(IID_IDispatch, (void **)&pDisp); if (FAILED(hr)) ! return OleSetOleError(hr); pEngine->Release(); return PyCom_PyObjectFromIUnknown(pDisp, IID_IDispatch, FALSE); --- 93,97 ---- HRESULT hr = pEngine->QueryInterface(IID_IDispatch, (void **)&pDisp); if (FAILED(hr)) ! return PyCom_BuildPyException(hr); pEngine->Release(); return PyCom_PyObjectFromIUnknown(pDisp, IID_IDispatch, FALSE); Index: win32template.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32template.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32template.cpp 27 Nov 1999 08:03:41 -0000 1.2 --- win32template.cpp 28 Jan 2005 22:40:01 -0000 1.3 *************** *** 443,447 **** if (PyErr_Occurred()) gui_print_error(); ! PyErr_SetString(PyExc_TypeError,"PyCTemplate::CreateNewFrame must return a PyCFrameWnd object."); gui_print_error(); return NULL; --- 443,450 ---- if (PyErr_Occurred()) gui_print_error(); ! const char *typ_str = retObject ? retObject->ob_type->tp_name : "<null>"; ! PyErr_Format(PyExc_TypeError, ! "PyCTemplate::CreateNewFrame must return a PyCFrameWnd object (got %s).", ! typ_str); gui_print_error(); return NULL; *************** *** 472,476 **** if (PyErr_Occurred()) gui_print_error(); ! PyErr_SetString(PyExc_TypeError,"PyCTemplate::CreateNewDocument must return a PyCDocument object."); TRACE0("CPythonDocTemplate::CreateNewDocument fails due to return type error\n"); return NULL; --- 475,482 ---- if (PyErr_Occurred()) gui_print_error(); ! const char *typ_str = retObject ? retObject->ob_type->tp_name : "<null>"; ! PyErr_Format(PyExc_TypeError, ! "PyCTemplate::CreateNewDocument must return a PyCDocument object (got %s).", ! typ_str); TRACE0("CPythonDocTemplate::CreateNewDocument fails due to return type error\n"); return NULL; *************** *** 499,503 **** if (PyErr_Occurred()) gui_print_error(); ! PyErr_SetString(PyExc_TypeError,"PyCTemplate::OpenDocumentFile must return a PyCDocument object."); TRACE0("CPythonDocTemplate::CreateNewDocument fails due to return type error\n"); return NULL; --- 505,512 ---- if (PyErr_Occurred()) gui_print_error(); ! const char *typ_str = retObject ? retObject->ob_type->tp_name : "<null>"; ! PyErr_Format(PyExc_TypeError, ! "PyCTemplate::OpenDocumentFile must return a PyCDocument object (got %s).", ! typ_str); TRACE0("CPythonDocTemplate::CreateNewDocument fails due to return type error\n"); return NULL; *************** *** 535,539 **** } CEnterLeavePython _celp; ! PyErr_SetString(PyExc_TypeError,"PyCTemplate::MatchDocType must return an integer or PyCDocument object."); gui_print_error(); return CDocTemplate::noAttempt; --- 544,550 ---- } CEnterLeavePython _celp; ! const char *typ_str = ret ? ret->ob_type->tp_name : "<null>"; ! PyErr_Format(PyExc_TypeError,"PyCTemplate::MatchDocType must return an integer or PyCDocument object (got %s).", ! typ_str); gui_print_error(); return CDocTemplate::noAttempt; |