From a5a50c7cfc54baceb02cc82424368660701b64f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Sun, 9 Apr 2017 12:39:40 +0200 Subject: [PATCH] Fixing error on Python 2.7 / Windows 64bits --- src/options.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/options.c b/src/options.c index 92571b2..a515841 100644 --- a/src/options.c +++ b/src/options.c @@ -171,11 +171,15 @@ option(PyObject *self, PyObject *args) if (!py_limit) 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( "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); if (error < 0) return Error_set(error);