@@ -65,11 +65,11 @@ option(PyObject *self, PyObject *args)
6565 if (!py_option )
6666 return NULL ;
6767
68- if (!PyLong_Check (py_option ))
68+ if (!PyInt_Check (py_option ))
6969 return Error_type_error (
7070 "option should be an integer, got %.200s" , py_option );
7171
72- option = PyLong_AsLong (py_option );
72+ option = PyInt_AsLong (py_option );
7373
7474 switch (option ) {
7575 case GIT_OPT_GET_SEARCH_PATH :
@@ -80,11 +80,11 @@ option(PyObject *self, PyObject *args)
8080 if (!py_level )
8181 return NULL ;
8282
83- if (!PyLong_Check (py_level ))
83+ if (!PyInt_Check (py_level ))
8484 return Error_type_error (
8585 "level should be an integer, got %.200s" , py_level );
8686
87- return get_search_path (PyLong_AsLong (py_level ));
87+ return get_search_path (PyInt_AsLong (py_level ));
8888 }
8989
9090 case GIT_OPT_SET_SEARCH_PATH :
@@ -101,7 +101,7 @@ option(PyObject *self, PyObject *args)
101101 if (!py_path )
102102 return NULL ;
103103
104- if (!PyLong_Check (py_level ))
104+ if (!PyInt_Check (py_level ))
105105 return Error_type_error (
106106 "level should be an integer, got %.200s" , py_level );
107107
@@ -110,7 +110,7 @@ option(PyObject *self, PyObject *args)
110110 return NULL ;
111111
112112 err = git_libgit2_opts (
113- GIT_OPT_SET_SEARCH_PATH , PyLong_AsLong (py_level ), path );
113+ GIT_OPT_SET_SEARCH_PATH , PyInt_AsLong (py_level ), path );
114114 Py_DECREF (tpath );
115115
116116 if (err < 0 )
@@ -127,7 +127,7 @@ option(PyObject *self, PyObject *args)
127127 if (error < 0 )
128128 return Error_set (error );
129129
130- return PyLong_FromSize_t (size );
130+ return PyInt_FromSize_t (size );
131131 }
132132
133133 case GIT_OPT_SET_MWINDOW_SIZE :
@@ -139,11 +139,11 @@ option(PyObject *self, PyObject *args)
139139 if (!py_size )
140140 return NULL ;
141141
142- if (!PyLong_Check (py_size ))
142+ if (!PyInt_Check (py_size ))
143143 return Error_type_error (
144144 "size should be an integer, got %.200s" , py_size );
145145
146- size = PyLong_AsSize_t (py_size );
146+ size = PyInt_AsSize_t (py_size );
147147 error = git_libgit2_opts (GIT_OPT_SET_MWINDOW_SIZE , size );
148148 if (error < 0 )
149149 return Error_set (error );
@@ -159,7 +159,7 @@ option(PyObject *self, PyObject *args)
159159 if (error < 0 )
160160 return Error_set (error );
161161
162- return PyLong_FromSize_t (limit );
162+ return PyInt_FromSize_t (limit );
163163 }
164164
165165 case GIT_OPT_SET_MWINDOW_MAPPED_LIMIT :
@@ -171,11 +171,11 @@ option(PyObject *self, PyObject *args)
171171 if (!py_limit )
172172 return NULL ;
173173
174- if (!PyLong_Check (py_limit ))
174+ if (!PyInt_Check (py_limit ))
175175 return Error_type_error (
176176 "limit should be an integer, got %.200s" , py_limit );
177177
178- limit = PyLong_AsSize_t (py_limit );
178+ limit = PyInt_AsSize_t (py_limit );
179179 error = git_libgit2_opts (GIT_OPT_SET_MWINDOW_MAPPED_LIMIT , limit );
180180 if (error < 0 )
181181 return Error_set (error );
@@ -197,12 +197,12 @@ option(PyObject *self, PyObject *args)
197197 if (!py_limit )
198198 return NULL ;
199199
200- if (!PyLong_Check (py_limit ))
200+ if (!PyInt_Check (py_limit ))
201201 return Error_type_error (
202202 "limit should be an integer, got %.200s" , py_limit );
203203
204- object_type = PyLong_AsLong (py_object_type );
205- limit = PyLong_AsSize_t (py_limit );
204+ object_type = PyInt_AsLong (py_object_type );
205+ limit = PyInt_AsSize_t (py_limit );
206206 error = git_libgit2_opts (
207207 GIT_OPT_SET_CACHE_OBJECT_LIMIT , object_type , limit );
208208
@@ -221,11 +221,11 @@ option(PyObject *self, PyObject *args)
221221 if (!py_max_size )
222222 return NULL ;
223223
224- if (!PyLong_Check (py_max_size ))
224+ if (!PyInt_Check (py_max_size ))
225225 return Error_type_error (
226226 "max_size should be an integer, got %.200s" , py_max_size );
227227
228- max_size = PyLong_AsSize_t (py_max_size );
228+ max_size = PyInt_AsSize_t (py_max_size );
229229 error = git_libgit2_opts (GIT_OPT_SET_CACHE_MAX_SIZE , max_size );
230230 if (error < 0 )
231231 return Error_set (error );
@@ -240,11 +240,11 @@ option(PyObject *self, PyObject *args)
240240
241241 py_flag = PyTuple_GetItem (args , 1 );
242242
243- if (!PyLong_Check (py_flag ))
243+ if (!PyInt_Check (py_flag ))
244244 return Error_type_error (
245245 "flag should be an integer, got %.200s" , py_flag );
246246
247- flag = PyLong_AsSize_t (py_flag );
247+ flag = PyInt_AsSize_t (py_flag );
248248 error = git_libgit2_opts (GIT_OPT_ENABLE_CACHING , flag );
249249 if (error < 0 )
250250 return Error_set (error );
@@ -262,8 +262,8 @@ option(PyObject *self, PyObject *args)
262262 if (error < 0 )
263263 return Error_set (error );
264264
265- PyTuple_SetItem (tup , 0 , PyLong_FromLong (current ));
266- PyTuple_SetItem (tup , 1 , PyLong_FromLong (allowed ));
265+ PyTuple_SetItem (tup , 0 , PyInt_FromLong (current ));
266+ PyTuple_SetItem (tup , 1 , PyInt_FromLong (allowed ));
267267
268268 return tup ;
269269 }
0 commit comments