Skip to content

Commit 8c01234

Browse files
committed
Fix lint
1 parent a6fed05 commit 8c01234

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

Lib/test/test_external_inspection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def foo():
116116
]
117117
self.assertEqual(stack_trace, [
118118
(ANY, thread_expected_stack_trace),
119-
(ANY, main_thread_stack_trace),
119+
(ANY, main_thread_stack_trace),
120120
])
121121

122122
@skip_if_not_supported

Modules/_remote_debugging_module.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ create_task_result(
778778
PyObject *tn = NULL;
779779
char task_obj[async_offsets->asyncio_task_object.size];
780780
uintptr_t coro_addr;
781-
781+
782782
result = PyList_New(0);
783783
if (result == NULL) {
784784
goto error;
@@ -788,7 +788,7 @@ create_task_result(
788788
if (call_stack == NULL) {
789789
goto error;
790790
}
791-
791+
792792
if (PyList_Append(result, call_stack)) {
793793
goto error;
794794
}
@@ -802,7 +802,7 @@ create_task_result(
802802
if (tn == NULL) {
803803
goto error;
804804
}
805-
805+
806806
if (PyList_Append(result, tn)) {
807807
goto error;
808808
}
@@ -823,7 +823,7 @@ create_task_result(
823823
if (call_stack == NULL) {
824824
goto error;
825825
}
826-
826+
827827
if (parse_coro_chain(handle, offsets, async_offsets, coro_addr,
828828
call_stack, code_object_cache) < 0) {
829829
Py_DECREF(call_stack);
@@ -1005,22 +1005,22 @@ setup_async_result_structure(PyObject **result, PyObject **calls)
10051005
if (*result == NULL) {
10061006
return -1;
10071007
}
1008-
1008+
10091009
*calls = PyList_New(0);
10101010
if (*calls == NULL) {
10111011
Py_DECREF(*result);
10121012
*result = NULL;
10131013
return -1;
10141014
}
1015-
1015+
10161016
if (PyList_SetItem(*result, 0, *calls)) { /* steals ref to 'calls' */
10171017
Py_DECREF(*calls);
10181018
Py_DECREF(*result);
10191019
*result = NULL;
10201020
*calls = NULL;
10211021
return -1;
10221022
}
1023-
1023+
10241024
return 0;
10251025
}
10261026

@@ -1031,12 +1031,12 @@ add_task_info_to_result(
10311031
uintptr_t running_task_addr
10321032
) {
10331033
PyObject *tn = parse_task_name(
1034-
&self->handle, &self->debug_offsets, &self->async_debug_offsets,
1034+
&self->handle, &self->debug_offsets, &self->async_debug_offsets,
10351035
running_task_addr);
10361036
if (tn == NULL) {
10371037
return -1;
10381038
}
1039-
1039+
10401040
if (PyList_Append(result, tn)) {
10411041
Py_DECREF(tn);
10421042
return -1;
@@ -1047,7 +1047,7 @@ add_task_info_to_result(
10471047
if (awaited_by == NULL) {
10481048
return -1;
10491049
}
1050-
1050+
10511051
if (PyList_Append(result, awaited_by)) {
10521052
Py_DECREF(awaited_by);
10531053
return -1;
@@ -1100,7 +1100,7 @@ process_single_task_node(
11001100
PyTuple_SET_ITEM(result_item, 0, task_id); // steals ref
11011101
PyTuple_SET_ITEM(result_item, 1, tn); // steals ref
11021102
PyTuple_SET_ITEM(result_item, 2, current_awaited_by); // steals ref
1103-
1103+
11041104
// References transferred to tuple
11051105
task_id = NULL;
11061106
tn = NULL;
@@ -1305,7 +1305,7 @@ parse_code_object(proc_handle_t *handle,
13051305

13061306
uintptr_t ip = instruction_pointer;
13071307
ptrdiff_t addrq;
1308-
1308+
13091309
#ifdef Py_GIL_DISABLED
13101310
// In free threading builds, we need to handle thread-local bytecode (TLBC)
13111311
// The instruction pointer might point to TLBC, so we need to calculate the offset
@@ -1314,7 +1314,7 @@ parse_code_object(proc_handle_t *handle,
13141314
// Try to read the TLBC array to get the correct bytecode base
13151315
uintptr_t tlbc_array_addr = real_address + offsets->code_object.co_tlbc;
13161316
uintptr_t tlbc_array_ptr;
1317-
1317+
13181318
if (read_ptr(handle, tlbc_array_addr, &tlbc_array_ptr) == 0 && tlbc_array_ptr != 0) {
13191319
// Read the TLBC array size
13201320
Py_ssize_t tlbc_size;
@@ -1323,7 +1323,7 @@ parse_code_object(proc_handle_t *handle,
13231323
for (Py_ssize_t i = 0; i < tlbc_size; i++) {
13241324
uintptr_t tlbc_entry_addr = tlbc_array_ptr + sizeof(Py_ssize_t) + (i * sizeof(void*));
13251325
uintptr_t tlbc_bytecode_addr;
1326-
1326+
13271327
if (read_ptr(handle, tlbc_entry_addr, &tlbc_bytecode_addr) == 0 && tlbc_bytecode_addr != 0) {
13281328
// Check if IP is within this TLBC range (rough estimate)
13291329
if (ip >= tlbc_bytecode_addr && ip < tlbc_bytecode_addr + 0x10000) {
@@ -1335,10 +1335,10 @@ parse_code_object(proc_handle_t *handle,
13351335
}
13361336
}
13371337
}
1338-
1338+
13391339
// Fall back to main bytecode
13401340
addrq = (uint16_t *)ip - (uint16_t *)meta->addr_code_adaptive;
1341-
1341+
13421342
found_offset:
13431343
(void)tlbc_index; // Suppress unused parameter warning
13441344
#else
@@ -1403,7 +1403,7 @@ process_single_stack_chunk(
14031403
) {
14041404
// Start with default size assumption
14051405
size_t current_size = _PY_DATA_STACK_CHUNK_SIZE;
1406-
1406+
14071407
char *this_chunk = PyMem_RawMalloc(current_size);
14081408
if (!this_chunk) {
14091409
PyErr_NoMemory();
@@ -1423,7 +1423,7 @@ process_single_stack_chunk(
14231423
PyErr_NoMemory();
14241424
return -1;
14251425
}
1426-
1426+
14271427
if (_Py_RemoteDebug_PagedReadRemoteMemory(handle, chunk_addr, actual_size, this_chunk) < 0) {
14281428
PyMem_RawFree(this_chunk);
14291429
return -1;
@@ -1447,7 +1447,7 @@ copy_stack_chunks(proc_handle_t *handle,
14471447
StackChunkInfo *chunks = NULL;
14481448
size_t count = 0;
14491449
size_t max_chunks = 16;
1450-
1450+
14511451
if (read_ptr(handle, tstate_addr + offsets->thread_state.datastack_chunk, &chunk_addr)) {
14521452
return -1;
14531453
}
@@ -1728,7 +1728,7 @@ find_running_task_and_coro(
17281728
) {
17291729
*running_task_addr = (uintptr_t)NULL;
17301730
if (find_running_task(
1731-
&self->handle, self->runtime_start_address,
1731+
&self->handle, self->runtime_start_address,
17321732
&self->debug_offsets, &self->async_debug_offsets,
17331733
running_task_addr) < 0) {
17341734
chain_exceptions(PyExc_RuntimeError, "Failed to find running task");
@@ -1950,14 +1950,14 @@ append_awaited_by_for_thread(
19501950
) {
19511951
char task_node[SIZEOF_LLIST_NODE];
19521952

1953-
if (_Py_RemoteDebug_PagedReadRemoteMemory(handle, head_addr,
1953+
if (_Py_RemoteDebug_PagedReadRemoteMemory(handle, head_addr,
19541954
sizeof(task_node), task_node) < 0) {
19551955
return -1;
19561956
}
19571957

19581958
size_t iteration_count = 0;
19591959
const size_t MAX_ITERATIONS = 2 << 15; // A reasonable upper bound
1960-
1960+
19611961
while (GET_MEMBER(uintptr_t, task_node, debug_offsets->llist_node.next) != head_addr) {
19621962
if (++iteration_count > MAX_ITERATIONS) {
19631963
PyErr_SetString(PyExc_RuntimeError, "Task list appears corrupted");
@@ -2069,10 +2069,10 @@ process_frame_chain(
20692069
}
20702070

20712071
// Try chunks first, fallback to direct memory read
2072-
if (parse_frame_from_chunks(handle, &frame, offsets, frame_addr,
2072+
if (parse_frame_from_chunks(handle, &frame, offsets, frame_addr,
20732073
&next_frame_addr, chunks, code_object_cache) < 0) {
20742074
PyErr_Clear();
2075-
if (parse_frame_object(handle, &frame, offsets, frame_addr,
2075+
if (parse_frame_object(handle, &frame, offsets, frame_addr,
20762076
&next_frame_addr, code_object_cache) < 0) {
20772077
return -1;
20782078
}
@@ -2133,7 +2133,7 @@ unwind_stack_for_thread(
21332133
goto error;
21342134
}
21352135

2136-
if (process_frame_chain(handle, offsets, frame_addr, &chunks,
2136+
if (process_frame_chain(handle, offsets, frame_addr, &chunks,
21372137
code_object_cache, frame_info) < 0) {
21382138
goto error;
21392139
}
@@ -2407,13 +2407,13 @@ _remote_debugging_RemoteUnwinder_get_async_stack_trace_impl(RemoteUnwinderObject
24072407

24082408
PyObject *result = NULL;
24092409
PyObject *calls = NULL;
2410-
2410+
24112411
if (setup_async_result_structure(&result, &calls) < 0) {
24122412
goto cleanup;
24132413
}
24142414

24152415
uintptr_t running_task_addr, running_coro_addr, running_task_code_obj;
2416-
if (find_running_task_and_coro(self, &running_task_addr,
2416+
if (find_running_task_and_coro(self, &running_task_addr,
24172417
&running_coro_addr, &running_task_code_obj) < 0) {
24182418
goto cleanup;
24192419
}

0 commit comments

Comments
 (0)