Fix bare except handlers in keyword_extractor.py #20
Reference in New Issue
Block a user
Delete Branch "fix/narrow-except-handlers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
except Exceptionon YAKE import (line 202) toexcept ImportErrorexcept Exceptionon YAKE extraction (line 211) toexcept (ValueError, TypeError)loggingwith warnings so failures are no longer silently swallowedWhy
The bare
except Exceptionhandlers caught everything includingKeyboardInterrupt,MemoryError, andSystemExit, and returned{}with no logging — making debugging impossible.Test plan
python -c "import ast; ast.parse(...)"— syntax OKpython -m unittest -q— all 10 tests passFixes #4