diff options
author | Raymond Hettinger <python@rcn.com> | 2008-06-22 11:39:13 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-06-22 11:39:13 (GMT) |
commit | d11a44312f2e80a9c4979063ce94233f924dcc5b (patch) | |
tree | 0b3e22010b4d0850aa80d32dcdb4ac3929dcbe03 /Objects/abstract.c | |
parent | dd811a4da785119089344f6de5735264f0ca5ec6 (diff) | |
download | cpython-d11a44312f2e80a9c4979063ce94233f924dcc5b.zip cpython-d11a44312f2e80a9c4979063ce94233f924dcc5b.tar.gz cpython-d11a44312f2e80a9c4979063ce94233f924dcc5b.tar.bz2 |
Merge 64438: hex/oct/bin can show floats exactly.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 60a5e84..0d40d17 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1451,8 +1451,11 @@ PyObject * PyNumber_ToBase(PyObject *n, int base) { PyObject *res = NULL; - PyObject *index = PyNumber_Index(n); + PyObject *index; + if (PyFloat_Check(n)) + return _float_to_base(n, base); + index = PyNumber_Index(n); if (!index) return NULL; if (PyLong_Check(index)) |