summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/unicodeobject.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index ac77114..68f11ff 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -13481,7 +13481,10 @@ formatlong(PyObject *val, int flags, int prec, int type)
case 'd':
case 'u':
/* 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;
case 'o':
numnondigits = 2;