Commit 0ae78250 authored by Boxiang Sun's avatar Boxiang Sun

if long is zero, do not add prefix when with oct

parent 057004c1
...@@ -373,9 +373,11 @@ extern "C" PyAPI_FUNC(PyObject*) _PyLong_Format(PyObject* aa, int base, int addL ...@@ -373,9 +373,11 @@ extern "C" PyAPI_FUNC(PyObject*) _PyLong_Format(PyObject* aa, int base, int addL
if (base == 2) if (base == 2)
os << "0b"; os << "0b";
else if (base == 8) else if (base == 8) {
os << (newstyle ? "0o" : "0"); if (!(mpz_sgn(v->n) == 0)) {
else if (base == 16) os << (newstyle ? "0o" : "0");
}
} else if (base == 16)
os << "0x"; os << "0x";
if (is_negative) if (is_negative)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment