diff --git a/Python/getargs.c b/Python/getargs.c index 8d90111e2de..ac85a6d0de3 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -669,7 +669,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, Py_ssize_t ival; if (float_argument_error(arg)) return converterr("integer", arg, msgbuf, bufsize); - ival = PyInt_AsSsize_t(arg); + ival = PyNumber_AsSsize_t(arg); if (ival == -1 && PyErr_Occurred()) return converterr("integer", arg, msgbuf, bufsize); *p = ival;