@@ -17,7 +17,7 @@ test_pytime_fromseconds(PyObject *self, PyObject *args)
1717 return NULL ;
1818 }
1919 PyTime_t ts = _PyTime_FromSeconds (seconds );
20- return _PyTime_AsLong (ts );
20+ return PyLong_FromInt64 (ts );
2121}
2222
2323static int
@@ -49,7 +49,7 @@ test_pytime_fromsecondsobject(PyObject *self, PyObject *args)
4949 if (_PyTime_FromSecondsObject (& ts , obj , round ) == -1 ) {
5050 return NULL ;
5151 }
52- return _PyTime_AsLong (ts );
52+ return PyLong_FromInt64 (ts );
5353}
5454
5555static PyObject *
@@ -64,7 +64,7 @@ test_PyTime_AsTimeval(PyObject *self, PyObject *args)
6464 return NULL ;
6565 }
6666 PyTime_t t ;
67- if (_PyTime_FromLong ( & t , obj ) < 0 ) {
67+ if (PyLong_AsInt64 ( obj , & t ) < 0 ) {
6868 return NULL ;
6969 }
7070 struct timeval tv ;
@@ -91,7 +91,7 @@ test_PyTime_AsTimeval_clamp(PyObject *self, PyObject *args)
9191 return NULL ;
9292 }
9393 PyTime_t t ;
94- if (_PyTime_FromLong ( & t , obj ) < 0 ) {
94+ if (PyLong_AsInt64 ( obj , & t ) < 0 ) {
9595 return NULL ;
9696 }
9797 struct timeval tv ;
@@ -113,7 +113,7 @@ test_PyTime_AsTimespec(PyObject *self, PyObject *args)
113113 return NULL ;
114114 }
115115 PyTime_t t ;
116- if (_PyTime_FromLong ( & t , obj ) < 0 ) {
116+ if (PyLong_AsInt64 ( obj , & t ) < 0 ) {
117117 return NULL ;
118118 }
119119 struct timespec ts ;
@@ -131,7 +131,7 @@ test_PyTime_AsTimespec_clamp(PyObject *self, PyObject *args)
131131 return NULL ;
132132 }
133133 PyTime_t t ;
134- if (_PyTime_FromLong ( & t , obj ) < 0 ) {
134+ if (PyLong_AsInt64 ( obj , & t ) < 0 ) {
135135 return NULL ;
136136 }
137137 struct timespec ts ;
@@ -149,14 +149,14 @@ test_PyTime_AsMilliseconds(PyObject *self, PyObject *args)
149149 return NULL ;
150150 }
151151 PyTime_t t ;
152- if (_PyTime_FromLong ( & t , obj ) < 0 ) {
152+ if (PyLong_AsInt64 ( obj , & t ) < 0 ) {
153153 return NULL ;
154154 }
155155 if (check_time_rounding (round ) < 0 ) {
156156 return NULL ;
157157 }
158158 PyTime_t ms = _PyTime_AsMilliseconds (t , round );
159- return _PyTime_AsLong (ms );
159+ return PyLong_FromInt64 (ms );
160160}
161161
162162static PyObject *
@@ -168,14 +168,14 @@ test_PyTime_AsMicroseconds(PyObject *self, PyObject *args)
168168 return NULL ;
169169 }
170170 PyTime_t t ;
171- if (_PyTime_FromLong ( & t , obj ) < 0 ) {
171+ if (PyLong_AsInt64 ( obj , & t ) < 0 ) {
172172 return NULL ;
173173 }
174174 if (check_time_rounding (round ) < 0 ) {
175175 return NULL ;
176176 }
177177 PyTime_t us = _PyTime_AsMicroseconds (t , round );
178- return _PyTime_AsLong (us );
178+ return PyLong_FromInt64 (us );
179179}
180180
181181static PyObject *
0 commit comments