Skip to content

Commit 4b4b20f

Browse files
authored
Merge pull request #167 from VectifyAI/fix/list-index-shadowing
Fix list_index variable shadowing in fix_incorrect_toc
2 parents 599d2ce + 85f17f9 commit 4b4b20f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pageindex/page_index.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,9 @@ async def process_and_check_item(incorrect_item):
807807
page_contents=[]
808808
for page_index in range(prev_correct, next_correct+1):
809809
# Add bounds checking to prevent IndexError
810-
list_index = page_index - start_index
811-
if list_index >= 0 and list_index < len(page_list):
812-
page_text = f"<physical_index_{page_index}>\n{page_list[list_index][0]}\n<physical_index_{page_index}>\n\n"
810+
page_list_idx = page_index - start_index
811+
if page_list_idx >= 0 and page_list_idx < len(page_list):
812+
page_text = f"<physical_index_{page_index}>\n{page_list[page_list_idx][0]}\n<physical_index_{page_index}>\n\n"
813813
page_contents.append(page_text)
814814
else:
815815
continue

0 commit comments

Comments
 (0)