summaryrefslogtreecommitdiffstats
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-01-19 22:35:27 (GMT)
committerGitHub <noreply@github.com>2021-01-19 22:35:27 (GMT)
commit66f77caca39ba39ebe1e4a95dba6d19b20d51951 (patch)
tree5a3e9d28e72c0c15c2e313b51eef7b239a0a4bdc /Python/traceback.c
parentcad8020cb83ec6d904f874c0e4f599e651022196 (diff)
downloadcpython-66f77caca39ba39ebe1e4a95dba6d19b20d51951.zip
cpython-66f77caca39ba39ebe1e4a95dba6d19b20d51951.tar.gz
cpython-66f77caca39ba39ebe1e4a95dba6d19b20d51951.tar.bz2
bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254)
Diffstat (limited to 'Python/traceback.c')
-rw-r--r--Python/traceback.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index bd5fd35..9363d4e 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, "???");