Mercurial > cpython-lru_cache-weakref
diff Objects/unicodeobject.c @ 76590:7bacccd889c2
Fix my previous commit: bool is a long, restore the specical case for bool
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Sat, 28 Apr 2012 00:25:34 +0200 |
| parents | f4837725c50f |
| children | 42fbb4f9b540 |
line wrap: on
line diff
--- a/Objects/unicodeobject.c Fri Apr 27 23:51:03 2012 +0200 +++ b/Objects/unicodeobject.c Sat Apr 28 00:25:34 2012 +0200 @@ -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;
