commit | b11d91d969d9444b4df3e786c1dbba53da5b3ff0 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@gmail.com> | Sat Apr 28 00:25:34 2012 +0200 |
committer | Victor Stinner <victor.stinner@gmail.com> | Sat Apr 28 00:25:34 2012 +0200 |
tree | 9dc1c303fa19dcbde31ad7e3aa71f440bc341329 | |
parent | 92ff4e196bfd5361f231ab8629025d28af1decab [diff] |
Fix my previous commit: bool is a long, restore the specical case for bool
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 @@ 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;