diff options
author | Guido van Rossum <guido@python.org> | 1992-08-14 15:13:07 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-08-14 15:13:07 (GMT) |
commit | 2c475427c26f013cf2050ed281637820abeedc10 (patch) | |
tree | 620766abe020c8e89534eb0d1e9fef1270173fe5 | |
parent | 96caaee8360762683629c4e6c440a2854f89983c (diff) | |
download | cpython-2c475427c26f013cf2050ed281637820abeedc10.zip cpython-2c475427c26f013cf2050ed281637820abeedc10.tar.gz cpython-2c475427c26f013cf2050ed281637820abeedc10.tar.bz2 |
oct(0) should return '0', not '00'
-rw-r--r-- | Objects/longobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 @@ long_format(aa, base) }) } 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'; |