mirror of
https://github.com/python/cpython.git
synced 2024-11-28 12:31:14 +08:00
Fix my previous commit: bool is a long, restore the specical case for bool
This commit is contained in:
parent
92ff4e196b
commit
b11d91d969
@ -13481,7 +13481,10 @@ formatlong(PyObject *val, int flags, int prec, int type)
|
|||||||
case 'd':
|
case 'd':
|
||||||
case 'u':
|
case 'u':
|
||||||
/* Special-case boolean: we want 0/1 */
|
/* Special-case boolean: we want 0/1 */
|
||||||
result = Py_TYPE(val)->tp_str(val);
|
if (PyBool_Check(val))
|
||||||
|
result = PyNumber_ToBase(val, 10);
|
||||||
|
else
|
||||||
|
result = Py_TYPE(val)->tp_str(val);
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
numnondigits = 2;
|
numnondigits = 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user