Skip to content

Commit 25c0188

Browse files
committed
Fix bug where format is not recognized
1 parent 1ff5f00 commit 25c0188

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55

66
[project]
77
name = "pytranscript"
8-
version = "0.2.2"
8+
version = "0.2.3"
99
description = "CLI to transcript and translate audio and video files"
1010
readme = "README.md"
1111
requires-python = ">=3.12"

src/pytranscript.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def transcribe_with_vosk(
400400
return transcript
401401

402402

403-
AllTranscriptFormats = TranscriptFormat | Literal["all"]
403+
ALL_TRANSCRIPT_FORMATS = (*TRANSCRIPT_FORMATS, "all")
404404

405405

406406
class ArgumentParser(tap.Tap):
@@ -447,9 +447,7 @@ class ArgumentParser(tap.Tap):
447447
3: debug. Default: 2."""
448448

449449
def _init_format(self):
450-
if not (
451-
self.format in typing.get_args(AllTranscriptFormats) or self.format is None
452-
):
450+
if not (self.format in ALL_TRANSCRIPT_FORMATS or self.format is None):
453451
msg = f"bad transcript format: {self.format}"
454452
raise ValueError(msg)
455453

0 commit comments

Comments
 (0)