Skip to content

Commit 5fa80a9

Browse files
committed
get_text: fail on unrecognized option instead of silently defaulting
Per review feedback from julian-smith-artifex-com: the intent was always to raise on an unrecognized option, not fall back to "text" silently. Removes the fallback and keeps the assert (which the earlier fix in this PR had already de-duplicated from its own missing-comma bug elsewhere).
1 parent 7bb15c5 commit 5fa80a9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎src/utils.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,7 @@ def get_text(
491491
"blocks": pymupdf.TEXTFLAGS_BLOCKS,
492492
}
493493
option = option.lower()
494-
if option not in formats:
495-
option = "text"
494+
assert option in formats
496495
if flags is None:
497496
flags = formats[option]
498497

0 commit comments

Comments
 (0)