Issue #13088: Add shared Py_hexdigits constant to format a number into base 16
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 @@
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 @@
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;