[Python-checkins] cpython: Fix my previous commit: bool is a long, restore the specical case for bool
victor.stinner
python-checkins at python.org
Sat Apr 28 00:28:10 CEST 2012
http://hg.python.org/cpython/rev/7bacccd889c2
changeset: 76590:7bacccd889c2
user: Victor Stinner <victor.stinner at gmail.com>
date: Sat Apr 28 00:25:34 2012 +0200
summary:
Fix my previous commit: bool is a long, restore the specical case for bool
files:
Objects/unicodeobject.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -13481,7 +13481,10 @@
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;
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list