Kaydet (Commit) ebee0256 authored tarafından Guido van Rossum's avatar Guido van Rossum

Changed hex() and oct() again, to never emit a '-' sign.

üst fde462e1
......@@ -725,10 +725,8 @@ int_oct(v)
long x = v -> ob_ival;
if (x == 0)
strcpy(buf, "0");
else if (-x < 0)
sprintf(buf, "0%lo", x);
else
sprintf(buf, "-0%lo", -x);
sprintf(buf, "0%lo", x);
return newstringobject(buf);
}
......@@ -738,10 +736,7 @@ int_hex(v)
{
char buf[20];
long x = v -> ob_ival;
if (-x <= 0)
sprintf(buf, "0x%lx", x);
else
sprintf(buf, "-0x%lx", -x);
sprintf(buf, "0x%lx", x);
return newstringobject(buf);
}
......
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