mirror of
https://github.com/python/cpython.git
synced 2025-09-04 07:51:13 +00:00
bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254)
This commit is contained in:
parent
cad8020cb8
commit
66f77caca3
5 changed files with 65 additions and 26 deletions
|
@ -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, "???");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue