From 66f77caca39ba39ebe1e4a95dba6d19b20d51951 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 19 Jan 2021 23:35:27 +0100 Subject: bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254) --- Python/traceback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Python/traceback.c') diff --git a/Python/traceback.c b/Python/traceback.c index bd5fd35215..9363d4eb1b 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -628,12 +628,12 @@ PyTraceBack_Print(PyObject *v, PyObject *f) This function is signal safe. */ void -_Py_DumpDecimal(int fd, unsigned long value) +_Py_DumpDecimal(int fd, size_t value) { /* maximum number of characters required for output of %lld or %p. We need at most ceil(log10(256)*SIZEOF_LONG_LONG) digits, plus 1 for the null byte. 53/22 is an upper bound for log10(256). */ - char buffer[1 + (sizeof(unsigned long)*53-1) / 22 + 1]; + char buffer[1 + (sizeof(size_t)*53-1) / 22 + 1]; char *ptr, *end; end = &buffer[Py_ARRAY_LENGTH(buffer) - 1]; @@ -767,7 +767,7 @@ dump_frame(int fd, PyFrameObject *frame) int lineno = PyCode_Addr2Line(code, frame->f_lasti); PUTS(fd, ", line "); if (lineno >= 0) { - _Py_DumpDecimal(fd, (unsigned long)lineno); + _Py_DumpDecimal(fd, (size_t)lineno); } else { PUTS(fd, "???"); -- cgit v1.2.1