transformers
c3ec5ff4 - fix: return empty tuple from import_protobuf_decode_error when protobuf is unavailable (#45486)

Commit
222 days ago
fix: return empty tuple from import_protobuf_decode_error when protobuf is unavailable (#45486) Previously the helper raised ImportError when protobuf was not installed. Because Python evaluates the except-class expression lazily, that ImportError replaced whatever the tokenizer constructor actually raised, and the RuntimeError/OSError handlers below never ran either. Return () instead so the except clause matches nothing and the real exception propagates. Fixes #45459 Co-authored-by: Ita Zaporozhets <31893021+itazap@users.noreply.github.com>
Author
Parents
Loading