cpython: b2f7bb63377b (original) (raw)

--- a/Include/traceback.h +++ b/Include/traceback.h @@ -94,7 +94,20 @@ PyAPI_FUNC(void) _Py_DumpASCII(int fd, P /* Format an integer as decimal into the file descriptor fd. This function is signal safe. */ -PyAPI_FUNC(void) _Py_DumpDecimal(int fd, unsigned long value); +PyAPI_FUNC(void) _Py_DumpDecimal(

+ +/* Format an integer as hexadecimal into the file descriptor fd with at least

#endif /* !Py_LIMITED_API */

--- a/Python/traceback.c +++ b/Python/traceback.c @@ -506,14 +506,15 @@ void This function is signal safe. */ -static void -dump_hexadecimal(int fd, unsigned long value, Py_ssize_t width) +void +_Py_DumpHexadecimal(int fd, unsigned long value, Py_ssize_t width) { char buffer[sizeof(unsigned long) * 2 + 1], *ptr, *end; const Py_ssize_t size = Py_ARRAY_LENGTH(buffer) - 1; if (width > size) width = size;

end = &buffer[size]; ptr = end; @@ -582,15 +583,15 @@ void } else if (ch <= 0xff) { PUTS(fd, "\x");