Skip to content

Commit 3b7413a

Browse files
authored
Merge pull request #73 from GitBib/fix
Fix
2 parents 3fce4ab + 7c61f0d commit 3b7413a

File tree

8 files changed

+131
-131
lines changed

8 files changed

+131
-131
lines changed

pymkv/MKVFile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def split_size(
722722
Raised if if `size` is not a bitmath object or an integer.
723723
"""
724724
if getattr(size, "__module__", None) == bitmath.__name__:
725-
size = cast(bitmath.Bitmath, size).bytes
725+
size = cast("bitmath.Bitmath", size).bytes
726726
elif not isinstance(size, int):
727727
msg = "size is not a bitmath object or integer"
728728
raise TypeError(msg)
@@ -1187,7 +1187,7 @@ def _flatten(item: T | Iterable[T | Iterable[T]]) -> Iterable[T]:
11871187
for subitem in item:
11881188
yield from _flatten(subitem)
11891189
else:
1190-
yield cast(T, item)
1190+
yield cast("T", item)
11911191

11921192
return list(_flatten(item))
11931193

pymkv/Timestamp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def hh(self) -> int:
250250
Returns:
251251
int: The hours value.
252252
"""
253-
return cast(int, self._hh)
253+
return cast("int", self._hh)
254254

255255
@hh.setter
256256
def hh(self, value: int) -> None:
@@ -270,7 +270,7 @@ def mm(self) -> int:
270270
Returns:
271271
int: The minutes value.
272272
"""
273-
return cast(int, self._mm)
273+
return cast("int", self._mm)
274274

275275
@mm.setter
276276
def mm(self, value: int) -> None:
@@ -290,7 +290,7 @@ def ss(self) -> int:
290290
Returns:
291291
int: The seconds value.
292292
"""
293-
return cast(int, self._ss)
293+
return cast("int", self._ss)
294294

295295
@ss.setter
296296
def ss(self, value: int) -> None:
@@ -310,7 +310,7 @@ def nn(self) -> int:
310310
Returns:
311311
int: The nanoseconds value.
312312
"""
313-
return cast(int, self._nn)
313+
return cast("int", self._nn)
314314

315315
@nn.setter
316316
def nn(self, value: int) -> None:
@@ -417,7 +417,7 @@ def splitting_timestamp(self, timestamp: str) -> None:
417417
assert timestamp_match is not None
418418
timestamp_groups = timestamp_match.groups()
419419

420-
timestamp_lst = [cast(str, timestamp_groups[i]) for i in (1, 2, 3, 4)]
420+
timestamp_lst = [cast("str", timestamp_groups[i]) for i in (1, 2, 3, 4)]
421421
timestamp_clean = []
422422
for ts in timestamp_lst:
423423
if ts is None:

pymkv/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ def wrapper(
9797
setattr(self, info_attr, fetch_func(*func_params, **fetch_kwargs))
9898
return method(self, *args, **kwargs)
9999

100-
return cast(Callable[..., T], wrapper)
100+
return cast("Callable[..., T]", wrapper)
101101

102102
return decorator

tests/test_actions_track.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_move_track_backward_and_mux(
182182

183183
def test_get_track(get_path_test_file: Path) -> None:
184184
mkv = MKVFile(get_path_test_file)
185-
track = cast(MKVTrack, mkv.get_track(1))
185+
track = cast("MKVTrack", mkv.get_track(1))
186186

187187
assert track.track_type == "audio"
188188

@@ -204,7 +204,7 @@ def test_added_lang_in_track_and_mux_file(
204204
) -> None:
205205
mkv = MKVFile(get_path_test_file)
206206
output_file = get_base_path / "file-test.mkv"
207-
track = cast(MKVTrack, mkv.get_track(1))
207+
track = cast("MKVTrack", mkv.get_track(1))
208208
track.language_ietf = "TEST"
209209
with pytest.raises(ValueError): # noqa: PT011
210210
mkv.mux(output_file)

tests/test_iso639_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_is_iso639_2_false() -> None:
1212

1313

1414
def test_is_iso639_2_non_str_input() -> None:
15-
assert is_iso639_2(cast(str, 123)) is False
15+
assert is_iso639_2(cast("str", 123)) is False
1616

1717

1818
def test_is_iso639_2_empty_string() -> None:

tests/test_timestamp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_getitem() -> None:
7676

7777
def test_invalid_input() -> None:
7878
with pytest.raises(TypeError):
79-
Timestamp(cast(str, [])) # Invalid type
79+
Timestamp(cast("str", [])) # Invalid type
8080

8181
with pytest.raises(ValueError): # noqa: PT011
8282
Timestamp("invalid_timestamp")
@@ -90,4 +90,4 @@ def test_ts_property() -> None:
9090
assert ts.ts == "02:30:00"
9191

9292
with pytest.raises(TypeError):
93-
ts.ts = cast(str, [])
93+
ts.ts = cast("str", [])

tests/test_utils_prepare_mkvtoolnix_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ def test_prepare_mkvmerge_path_with_pathlike() -> None:
5454

5555
def test_prepare_mkvmerge_path_with_invalid_argument() -> None:
5656
with pytest.raises(ValueError): # noqa: PT011
57-
utils.prepare_mkvtoolnix_path(cast(str, 123))
57+
utils.prepare_mkvtoolnix_path(cast("str", 123))

uv.lock

Lines changed: 117 additions & 117 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)