Skip to content

Commit 1d4c857

Browse files
committed
fixup! fixup! fixup! Update Modules/_testexternalinspection.c
1 parent a12e9ae commit 1d4c857

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

Modules/_testexternalinspection.c

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@
4646
#include "Python.h"
4747
#include <internal/pycore_runtime.h>
4848

49-
50-
// This values comes from FRAME_OWNED_BY_CSTACK in Include/internal/pycore_frame.h, which is not
51-
// included here as tools that do what we are testing won't have access to it.
52-
static FRAME_OWNED_BY_CSTACK = 3;
53-
5449
#ifndef HAVE_PROCESS_VM_READV
5550
# define HAVE_PROCESS_VM_READV 0
5651
#endif
@@ -207,8 +202,7 @@ get_py_runtime_macos(pid_t pid)
207202
char* filename = strrchr(map_filename, '/');
208203
if (filename != NULL) {
209204
filename++; // Move past the '/'
210-
}
211-
else {
205+
} else {
212206
filename = map_filename; // No path, use the whole string
213207
}
214208

@@ -253,8 +247,7 @@ find_python_map_start_address(pid_t pid, char* result_filename)
253247
char* filename = strrchr(map_filename, '/');
254248
if (filename != NULL) {
255249
filename++; // Move past the '/'
256-
}
257-
else {
250+
} else {
258251
filename = map_filename; // No path, use the whole string
259252
}
260253

@@ -500,9 +493,8 @@ parse_frame_object(
500493
}
501494

502495
char owner;
503-
bytes_read = read_memory(pid,
504-
(void*)(address + offsets->interpreter_frame.owner),
505-
sizeof(char), &owner);
496+
bytes_read =
497+
read_memory(pid, (void*)(address + offsets->interpreter_frame.owner), sizeof(char), &owner);
506498
if (bytes_read < 0) {
507499
return -1;
508500
}
@@ -617,10 +609,10 @@ static PyMethodDef methods[] = {
617609
};
618610

619611
static struct PyModuleDef module = {
620-
.m_base = PyModuleDef_HEAD_INIT,
621-
.m_name = "_testexternalinspection",
622-
.m_size = -1,
623-
.m_methods = methods,
612+
.m_base = PyModuleDef_HEAD_INIT,
613+
.m_name = "_testexternalinspection",
614+
.m_size = -1,
615+
.m_methods = methods,
624616
};
625617

626618
PyMODINIT_FUNC
@@ -633,4 +625,4 @@ PyInit__testexternalinspection(void)
633625
return NULL;
634626
}
635627
return mod;
636-
}
628+
}

0 commit comments

Comments
 (0)