Consistent with the behavior in Python 2.
Core and Builtins
-----------------
+- Issue #16772: The int() constructor's second argument (base) no longer
+ accepts non integer values. Consistent with the behavior in Python 2.
+
- Issue #15422: Get rid of PyCFunction_New macro. Use PyCFunction_NewEx
function (PyCFunction_New func is still present for backward compatibility).
return PyLong_FromLong(0L);
if (obase == NULL)
return PyNumber_Long(x);
+ if (!PyLong_Check(obase)) {
+ PyErr_SetString(PyExc_TypeError,
+ "int() arg 2 must be an integer.");
+ return NULL;
+ }
base = PyLong_AsLongAndOverflow(obase, &overflow);
if (base == -1 && PyErr_Occurred())