mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
oct(0) should return '0', not '00'
This commit is contained in:
parent
96caaee836
commit
2c475427c2
1 changed files with 4 additions and 2 deletions
|
@ -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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue