Update of /cvsroot/pywin32/pywin32/win32/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23478
Modified Files:
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.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** odbc.cpp 11 Oct 2008 01:09:03 -0000 1.23
--- odbc.cpp 11 Oct 2008 03:22:11 -0000 1.24
***************
*** 897,901 ****
TmpPyObject usec=PyObject_GetAttrString(item, "microsecond");
! if (usec != NULL){
dt->fraction=PyLong_AsUnsignedLong(usec);
if (dt->fraction == -1 && PyErr_Occurred())
--- 897,909 ----
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())
***************
*** 904,909 ****
dt->fraction *= 1000;
}
- else
- PyErr_Clear();
}
--- 912,915 ----
|