convert from long long to PyLong loselessly (#1106) (#1121)

This commit is contained in:
Benjamin Peterson 2017-04-13 14:11:48 -07:00 committed by GitHub
parent 9366332822
commit 04ac853945

View file

@ -3812,7 +3812,7 @@ test_PyTime_AsTimeval(PyObject *self, PyObject *args)
if (_PyTime_AsTimeval(t, &tv, round) < 0) if (_PyTime_AsTimeval(t, &tv, round) < 0)
return NULL; return NULL;
seconds = PyLong_FromLong((long long)tv.tv_sec); seconds = PyLong_FromLongLong(tv.tv_sec);
if (seconds == NULL) if (seconds == NULL)
return NULL; return NULL;
return Py_BuildValue("Nl", seconds, tv.tv_usec); return Py_BuildValue("Nl", seconds, tv.tv_usec);