@@ -125,7 +125,7 @@ SaneDev_fileno(SaneDevObject *self, PyObject *args)
125125 SANE_Status st = sane_get_select_fd (self -> h , & fd );
126126 if (st != SANE_STATUS_GOOD )
127127 return PySane_Error (st );
128- return PyInt_FromLong (fd );
128+ return PyLong_FromLong (fd );
129129}
130130
131131static PyObject *
@@ -209,7 +209,7 @@ SaneDev_get_options(SaneDevObject *self, PyObject *args)
209209 if (d -> type == SANE_TYPE_INT )
210210 for (j = 1 ; j <= d -> constraint .word_list [0 ]; ++ j )
211211 PyList_SetItem (constraint , j - 1 ,
212- PyInt_FromLong (d -> constraint .word_list [j ]));
212+ PyLong_FromLong (d -> constraint .word_list [j ]));
213213 else if (d -> type == SANE_TYPE_FIXED )
214214 for (j = 1 ; j <= d -> constraint .word_list [0 ]; ++ j )
215215 PyList_SetItem (constraint , j - 1 ,
@@ -313,13 +313,13 @@ SaneDev_set_option(SaneDevObject *self, PyObject *args)
313313 {
314314 case SANE_TYPE_BOOL :
315315 case SANE_TYPE_INT :
316- if (!PyInt_Check (value ))
316+ if (!PyLong_Check (value ))
317317 {
318318 PyErr_SetString (PyExc_TypeError , "SANE_INT and SANE_BOOL require an integer" );
319319 free (v );
320320 return NULL ;
321321 }
322- wordval = PyInt_AsLong (value );
322+ wordval = PyLong_AsLong (value );
323323 memcpy (v , & wordval , sizeof (SANE_Word ));
324324 break ;
325325 case SANE_TYPE_FIXED :
@@ -747,7 +747,7 @@ PySane_OPTION_IS_ACTIVE(PyObject *self, PyObject *args)
747747 return NULL ;
748748
749749 SANE_Int cap = lg ;
750- return PyInt_FromLong ( SANE_OPTION_IS_ACTIVE (cap ));
750+ return PyLong_FromLong ( SANE_OPTION_IS_ACTIVE (cap ));
751751}
752752
753753static PyObject *
@@ -758,7 +758,7 @@ PySane_OPTION_IS_SETTABLE(PyObject *self, PyObject *args)
758758 return NULL ;
759759
760760 SANE_Int cap = lg ;
761- return PyInt_FromLong ( SANE_OPTION_IS_SETTABLE (cap ));
761+ return PyLong_FromLong ( SANE_OPTION_IS_SETTABLE (cap ));
762762}
763763
764764/* List of functions defined in the module */
@@ -776,7 +776,7 @@ static PyMethodDef PySane_methods[] = {
776776static void
777777insint (PyObject * d , char * name , int value )
778778{
779- PyObject * v = PyInt_FromLong ((long ) value );
779+ PyObject * v = PyLong_FromLong ((long ) value );
780780 if (!v || PyDict_SetItemString (d , name , v ) == -1 )
781781 PyErr_SetString (ErrorObject , "Can't initialize sane module" );
782782
0 commit comments