[pywin32-checkins] pywin32/com/win32comext/shell/src PyIShellFolder.cpp,1.8,1.9
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2004-10-06 05:17:40
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18104 Modified Files: PyIShellFolder.cpp Log Message: Make ParseDisplayName emit a sane error message when the result is not a tuple. Index: PyIShellFolder.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PyIShellFolder.cpp 2 Jul 2004 04:10:53 -0000 1.8 --- PyIShellFolder.cpp 6 Oct 2004 05:17:15 -0000 1.9 *************** *** 438,444 **** PyObject *obppidl; ULONG chEaten, dwAttributes; - if (!PyArg_ParseTuple(result, "lOl" , &chEaten, &obppidl, &dwAttributes)) - return PyCom_SetAndLogCOMErrorFromPyException("ParseDisplayName", IID_IShellFolder); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsPIDL(obppidl, ppidl)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = PyCom_SetAndLogCOMErrorFromPyException("ParseDisplayName", IID_IShellFolder); --- 438,450 ---- PyObject *obppidl; ULONG chEaten, dwAttributes; BOOL bPythonIsHappy = TRUE; + if (!PyTuple_Check(result)) { + PyErr_Format(PyExc_TypeError, + "ParseDisplayName must return a tuple if (int, pidl, attr) - got '%s'", + result->ob_type->tp_name); + bPythonIsHappy = FALSE; + } + if (bPythonIsHappy && !PyArg_ParseTuple(result, "lOl" , &chEaten, &obppidl, &dwAttributes)) + bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyObject_AsPIDL(obppidl, ppidl)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = PyCom_SetAndLogCOMErrorFromPyException("ParseDisplayName", IID_IShellFolder); |