summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-09-03 08:55:11 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-09-03 08:55:11 (GMT)
commitf0f1c239e4addd15180d605306a969a627cb19d5 (patch)
treeb9d88594efebecef059d38320110c1942839be58 /Python/bltinmodule.c
parent22c108f0194e1e75e359b9861af28c33fe55a795 (diff)
downloadcpython-f0f1c239e4addd15180d605306a969a627cb19d5.zip
cpython-f0f1c239e4addd15180d605306a969a627cb19d5.tar.gz
cpython-f0f1c239e4addd15180d605306a969a627cb19d5.tar.bz2
Issue 27936: Fix inconsistent round() behavior between float and int
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 9e35eb2..9f5db2a 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -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);