summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-12 19:48:03 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-12 19:48:03 (GMT)
commitebee0256f35d9d450f718de0eaf49f0bfc6ae1bc (patch)
tree951e9337f2e0e7340255dc6222d648737372208b /Objects
parentfde462e1739b469a12ee2cb2db8a1e3a4e9c66b4 (diff)
downloadcpython-ebee0256f35d9d450f718de0eaf49f0bfc6ae1bc.zip
cpython-ebee0256f35d9d450f718de0eaf49f0bfc6ae1bc.tar.gz
cpython-ebee0256f35d9d450f718de0eaf49f0bfc6ae1bc.tar.bz2
Changed hex() and oct() again, to never emit a '-' sign.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/intobject.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c
index c4ade84..76d9145 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -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);
}