Issue 27936: Fix inconsistent round() behavior between float and int

This commit is contained in:
Raymond Hettinger 2016-09-03 01:55:11 -07:00
parent 22c108f019
commit f0f1c239e4
4 changed files with 17 additions and 2 deletions

View file

@ -2039,7 +2039,7 @@ builtin_round(PyObject *self, PyObject *args, PyObject *kwds)
return NULL;
}
if (ndigits == NULL)
if (ndigits == NULL || ndigits == Py_None)
result = PyObject_CallFunctionObjArgs(round, NULL);
else
result = PyObject_CallFunctionObjArgs(round, ndigits, NULL);