summaryrefslogtreecommitdiffstats
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-10-14 00:13:11 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-10-14 00:13:11 (GMT)
commitf5cff56a1be70d2c4e5cde5fa4e5d5d92e620dda (patch)
tree0eb7ea39ee5a60f384db53d5729b48d73986920d /Objects/bytesobject.c
parente506437b52507609772e8141fdbb5ad2e17471bb (diff)
downloadcpython-f5cff56a1be70d2c4e5cde5fa4e5d5d92e620dda.zip
cpython-f5cff56a1be70d2c4e5cde5fa4e5d5d92e620dda.tar.gz
cpython-f5cff56a1be70d2c4e5cde5fa4e5d5d92e620dda.tar.bz2
Issue #13088: Add shared Py_hexdigits constant to format a number into base 16
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r--Objects/bytesobject.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index fa0e8c2..17e31b9 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -564,7 +564,6 @@ PyBytes_AsStringAndSize(register PyObject *obj,
PyObject *
PyBytes_Repr(PyObject *obj, int smartquotes)
{
- static const char *hexdigits = "0123456789abcdef";
register PyBytesObject* op = (PyBytesObject*) obj;
Py_ssize_t i, length = Py_SIZE(op);
size_t newsize, squotes, dquotes;
@@ -620,8 +619,8 @@ PyBytes_Repr(PyObject *obj, int smartquotes)
else if (c < ' ' || c >= 0x7f) {
*p++ = '\\';
*p++ = 'x';
- *p++ = hexdigits[(c & 0xf0) >> 4];
- *p++ = hexdigits[c & 0xf];
+ *p++ = Py_hexdigits[(c & 0xf0) >> 4];
+ *p++ = Py_hexdigits[c & 0xf];
}
else
*p++ = c;