diff options
| author | jvoisin | 2023-11-13 15:03:42 +0100 |
|---|---|---|
| committer | jvoisin | 2023-11-13 15:03:42 +0100 |
| commit | 0fcafa2eddd34f15f34ad0a40f662cf3d5bcef0e (patch) | |
| tree | da8fc5b1469f53fc6f5c3049b13f20cbcc2abe09 /libmat2/audio.py | |
| parent | 7405955ab5995b06c929148f0439670c9be7cb2d (diff) | |
Raise a ValueError for invalid FLAC files to please mypy
Diffstat (limited to '')
| -rw-r--r-- | libmat2/audio.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libmat2/audio.py b/libmat2/audio.py index 4e447c5..2029d9c 100644 --- a/libmat2/audio.py +++ b/libmat2/audio.py | |||
| @@ -82,6 +82,8 @@ class FLACParser(MutagenParser): | |||
| 82 | with open(fname, 'wb') as f: | 82 | with open(fname, 'wb') as f: |
| 83 | f.write(picture.data) | 83 | f.write(picture.data) |
| 84 | p, _ = parser_factory.get_parser(fname) # type: ignore | 84 | p, _ = parser_factory.get_parser(fname) # type: ignore |
| 85 | if p is None: | ||
| 86 | raise ValueError | ||
| 85 | p.sandbox = self.sandbox | 87 | p.sandbox = self.sandbox |
| 86 | # Mypy chokes on ternaries :/ | 88 | # Mypy chokes on ternaries :/ |
| 87 | meta[name] = p.get_meta() if p else 'harmful data' # type: ignore | 89 | meta[name] = p.get_meta() if p else 'harmful data' # type: ignore |
