Skip to content

chore: remove unreachable pre-3.5 recursive glob code#27

Merged
knep merged 1 commit into
masterfrom
chore/remove-dead-glob
Jun 24, 2026
Merged

chore: remove unreachable pre-3.5 recursive glob code#27
knep merged 1 commit into
masterfrom
chore/remove-dead-glob

Conversation

@knep

@knep knep commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Removes dead code in src/utils/file_utils.py.

search_glob() guarded its modern implementation with if sys.version_info >= (3, 5), which is always true on this project (Python 3.10+). The else branch and the _pre_3_5_recursive_glob() helper it called (~65 lines) were unreachable.

Changes

  • Simplify search_glob() to call glob.glob(path_pattern, recursive=recursive) directly.
  • Delete the _pre_3_5_recursive_glob() helper.
  • Remove the now-unused import sys.

Why

Pure dead-code removal — the kept path is exactly the one that already ran, so there is no behaviour change. Also trims ~65 lines from the coverage denominator.

Testing

  • pytest src/tests/1737 passed. Existing search_glob tests in file_utils_extra_test.py (non-recursive *.txt and recursive **/*.txt) exercise the retained path.
  • Verified no remaining references to _pre_3_5_recursive_glob or sys in the file.

🤖 Generated with Claude Code

search_glob() guarded its modern path with `if sys.version_info >= (3, 5)`,
always true on this project (Python 3.10+). The else branch and the
_pre_3_5_recursive_glob() helper it called (~65 lines) were therefore dead.

Simplify search_glob() to call glob.glob() directly, drop the helper, and remove
the now-unused `import sys`. No behaviour change — the kept path is the one that
already ran; existing search_glob tests (non-recursive and recursive **) cover it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@knep knep merged commit e629034 into master Jun 24, 2026
15 of 16 checks passed
@knep knep deleted the chore/remove-dead-glob branch June 24, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants