[pywin32-checkins] pywin32/win32/src odbc.cpp,1.20.2.9,1.20.2.10
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2008-10-11 03:04:33
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22764 Modified Files: Tag: py3k odbc.cpp Log Message: Convert microseconds to a long for Python 2.3 Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.20.2.9 retrieving revision 1.20.2.10 diff -C2 -d -r1.20.2.9 -r1.20.2.10 *** odbc.cpp 11 Oct 2008 01:16:52 -0000 1.20.2.9 --- odbc.cpp 11 Oct 2008 03:04:22 -0000 1.20.2.10 *************** *** 895,899 **** TmpPyObject usec=PyObject_GetAttrString(item, "microsecond"); ! if (usec != NULL){ dt->fraction=PyLong_AsUnsignedLong(usec); if (dt->fraction == -1 && PyErr_Occurred()) --- 895,907 ---- TmpPyObject usec=PyObject_GetAttrString(item, "microsecond"); ! if (usec == NULL) ! PyErr_Clear(); ! else{ ! // In Python 2.3 PyLong_AsUnsignedLong will not accept a regular int ! #if (PY_VERSION_HEX < 0x02400000) ! usec=PyNumber_Long(usec); ! if (usec == NULL) ! return 0; ! #endif dt->fraction=PyLong_AsUnsignedLong(usec); if (dt->fraction == -1 && PyErr_Occurred()) *************** *** 902,907 **** dt->fraction *= 1000; } - else - PyErr_Clear(); } --- 910,913 ---- |