Fixing error on Python 2.7 / Windows 64bits
This commit is contained in:
@@ -171,11 +171,15 @@ option(PyObject *self, PyObject *args)
|
|||||||
if (!py_limit)
|
if (!py_limit)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!PyInt_Check(py_limit))
|
if (PyInt_Check(py_limit)) {
|
||||||
|
limit = PyInt_AsSize_t(py_limit);
|
||||||
|
} else if (PyLong_Check(py_limit)) {
|
||||||
|
limit = PyLong_AsSize_t(py_limit);
|
||||||
|
} else {
|
||||||
return Error_type_error(
|
return Error_type_error(
|
||||||
"limit should be an integer, got %.200s", py_limit);
|
"limit should be an integer, got %.200s", py_limit);
|
||||||
|
}
|
||||||
|
|
||||||
limit = PyInt_AsSize_t(py_limit);
|
|
||||||
error = git_libgit2_opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, limit);
|
error = git_libgit2_opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, limit);
|
||||||
if (error < 0)
|
if (error < 0)
|
||||||
return Error_set(error);
|
return Error_set(error);
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PyLong_AsSize_t
|
#ifndef PyLong_AsSize_t
|
||||||
#define PyLong_AsSize_t (size_t)PyLong_AsUnsignedLong
|
#define PyLong_AsSize_t (size_t)PyLong_AsSsize_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PY_MAJOR_VERSION == 2
|
#if PY_MAJOR_VERSION == 2
|
||||||
|
Reference in New Issue
Block a user