Fixed typo in string.

This commit is contained in:
Tim Peters 2002-12-19 01:44:38 +00:00
parent c296c63c73
commit 0b0f41cf1f

View file

@ -1326,6 +1326,7 @@ microseconds_to_delta(PyObject *pyus)
int us; int us;
int s; int s;
int d; int d;
long temp;
PyObject *tuple = NULL; PyObject *tuple = NULL;
PyObject *num = NULL; PyObject *num = NULL;
@ -1338,8 +1339,12 @@ microseconds_to_delta(PyObject *pyus)
num = PyTuple_GetItem(tuple, 1); /* us */ num = PyTuple_GetItem(tuple, 1); /* us */
if (num == NULL) if (num == NULL)
goto Done; goto Done;
us = PyLong_AsLong(num); temp = PyLong_AsLong(num);
num = NULL; num = NULL;
if (temp == -1 && PyErr_Occurred())
goto Done;
assert(0 <= temp && temp < 1000000);
us = (int)temp;
if (us < 0) { if (us < 0) {
/* The divisor was positive, so this must be an error. */ /* The divisor was positive, so this must be an error. */
assert(PyErr_Occurred()); assert(PyErr_Occurred());
@ -1360,8 +1365,13 @@ microseconds_to_delta(PyObject *pyus)
num = PyTuple_GetItem(tuple, 1); /* seconds */ num = PyTuple_GetItem(tuple, 1); /* seconds */
if (num == NULL) if (num == NULL)
goto Done; goto Done;
s = PyLong_AsLong(num); temp = PyLong_AsLong(num);
num = NULL; num = NULL;
if (temp == -1 && PyErr_Occurred())
goto Done;
assert(0 <= temp && temp < 24*3600);
s = (int)temp;
if (s < 0) { if (s < 0) {
/* The divisor was positive, so this must be an error. */ /* The divisor was positive, so this must be an error. */
assert(PyErr_Occurred()); assert(PyErr_Occurred());
@ -1372,10 +1382,15 @@ microseconds_to_delta(PyObject *pyus)
if (num == NULL) if (num == NULL)
goto Done; goto Done;
Py_INCREF(num); Py_INCREF(num);
temp = PyLong_AsLong(num);
d = PyLong_AsLong(num); if (temp == -1 && PyErr_Occurred())
if (d == -1 && PyErr_Occurred())
goto Done; goto Done;
d = (int)temp;
if ((long)d != temp) {
PyErr_SetString(PyExc_OverflowError, "normalized days too "
"large to fit in a C int");
goto Done;
}
result = new_delta(d, s, us, 0); result = new_delta(d, s, us, 0);
Done: Done: