fix(utils): add missing re import for start_index parsing helpers#116
fix(utils): add missing re import for start_index parsing helpers#116GeYugong wants to merge 1 commit intoVectifyAI:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a runtime error by adding the missing import re statement in pageindex/utils.py. The functions get_first_start_page_from_text and get_last_start_page_from_text were using re.search and re.finditer respectively without importing the re module, which would cause a NameError when these functions are called.
Changes:
- Added
import reto the import section ofpageindex/utils.py
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. The fix is correct: 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Summary
import reinpageindex/utils.pyget_first_start_page_from_textget_last_start_page_from_textWhy
These helpers call
re.search/re.finditer, butrewas not imported, which can raiseNameErrorwhen thefunctions are used.
Scope
Minimal fix only, no behavior change beyond preventing the runtime error.