diff --git a/python/svmc_wrap.c b/python/svmc_wrap.c
index 22ea45d..c4282b1 100644
--- a/python/svmc_wrap.c
+++ b/python/svmc_wrap.c
@@ -758,7 +758,7 @@ SWIG_Python_str_AsChar(PyObject *str)
 #if PY_VERSION_HEX >= 0x03000000
   char *cstr;
   char *newstr;
-  int len;
+  Py_ssize_t len;
   str = PyUnicode_AsUTF8String(str);
   PyBytes_AsStringAndSize(str, &cstr, &len);
   newstr = (char *) malloc(len+1);