From: Guido van Rossum Date: Fri, 14 Aug 1992 15:13:07 +0000 (+0000) Subject: oct(0) should return '0', not '00' X-Git-Tag: v0.9.8~225 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c475427c26f013cf2050ed281637820abeedc10;p=thirdparty%2FPython%2Fcpython.git oct(0) should return '0', not '00' --- diff --git a/Objects/longobject.c b/Objects/longobject.c index f9e37650f328..7ede30c0e17e 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';