[pywin32-checkins] pywin32/com/win32com/src oleargs.cpp,1.47,1.48
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2010-01-23 17:25:55
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv13761 Modified Files: oleargs.cpp Log Message: Move boolean checks above PyLong_Check Skip redundant PyInt_Check in Py3k Index: oleargs.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/oleargs.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** oleargs.cpp 8 Jul 2009 02:12:07 -0000 1.47 --- oleargs.cpp 23 Jan 2010 17:25:47 -0000 1.48 *************** *** 61,64 **** --- 61,75 ---- V_VT(var) = VT_BSTR; } + // For 3.x, bool checks need to be above PyLong_Check, which now succeeds for booleans. + else if (obj == Py_True) + { + V_VT(var) = VT_BOOL; + V_BOOL(var) = VARIANT_TRUE; + } + else if (obj == Py_False) + { + V_VT(var) = VT_BOOL; + V_BOOL(var) = VARIANT_FALSE; + } else if (PyLong_Check(obj)) { *************** *** 98,111 **** V_VT(var) = VT_NULL; } ! else if (obj == Py_True) ! { ! V_VT(var) = VT_BOOL; ! V_BOOL(var) = VARIANT_TRUE; ! } ! else if (obj == Py_False) ! { ! V_VT(var) = VT_BOOL; ! V_BOOL(var) = VARIANT_FALSE; ! } else if (PyInt_Check(obj)) { --- 109,114 ---- V_VT(var) = VT_NULL; } ! #if (PY_VERSION_HEX < 0x03000000) ! // This is redundant in 3.x, since PyInt_Check is #defined to PyLong_Check else if (PyInt_Check(obj)) { *************** *** 113,116 **** --- 116,120 ---- V_I4(var) = PyInt_AsLong(obj); } + #endif else if (PyObject_HasAttrString(obj, "_oleobj_")) { |