commit | 2c475427c26f013cf2050ed281637820abeedc10 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Fri Aug 14 15:13:07 1992 +0000 |
committer | Guido van Rossum <guido@python.org> | Fri Aug 14 15:13:07 1992 +0000 |
tree | 620766abe020c8e89534eb0d1e9fef1270173fe5 | |
parent | 96caaee8360762683629c4e6c440a2854f89983c [diff] [blame] |
oct(0) should return '0', not '00'
diff --git a/Objects/longobject.c b/Objects/longobject.c index f9e3765..7ede30c 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c
@@ -322,8 +322,10 @@ }) } while (ABS(a->ob_size) != 0); DECREF(a); - if (base == 8) - *--p = '0'; + if (base == 8) { + if (size_a != 0) + *--p = '0'; + } else if (base == 16) { *--p = 'x'; *--p = '0';