diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-14 00:13:11 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-14 00:13:11 (GMT) |
commit | f5cff56a1be70d2c4e5cde5fa4e5d5d92e620dda (patch) | |
tree | 0eb7ea39ee5a60f384db53d5729b48d73986920d /Objects/bytearrayobject.c | |
parent | e506437b52507609772e8141fdbb5ad2e17471bb (diff) | |
download | cpython-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/bytearrayobject.c')
-rw-r--r-- | Objects/bytearrayobject.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index cd35037..41ea2dd 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -850,7 +850,6 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) static PyObject * bytearray_repr(PyByteArrayObject *self) { - static const char *hexdigits = "0123456789abcdef"; const char *quote_prefix = "bytearray(b"; const char *quote_postfix = ")"; Py_ssize_t length = Py_SIZE(self); @@ -912,8 +911,8 @@ bytearray_repr(PyByteArrayObject *self) 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; |