Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Oct 7, 2024
1 parent 9d0a736 commit 24e0d28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions subliminal/subtitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,9 @@ def find_potential_encodings(language: Language) -> list[str]: # pragma: no cov
return ['windows-1251', 'iso-8859-5']

if language.alpha3 == 'srp':
if language.script == 'Latn':
if language.script is not None and language.script.code == 'Latn':
return ['windows-1250', 'iso-8859-2']
if language.script == 'Cyrl':
if language.script is not None and language.script.code == 'Cyrl':
return ['windows-1251', 'iso-8859-5']
return ['windows-1250', 'windows-1251', 'iso-8859-2', 'iso-8859-5']

Expand Down
3 changes: 2 additions & 1 deletion subliminal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import platform
import re
import socket
from collections.abc import Iterable
from datetime import datetime, timedelta, timezone
from types import GeneratorType
from typing import TYPE_CHECKING, Any, Callable, Generic, Iterable, TypeVar, cast, overload
from typing import TYPE_CHECKING, Any, Callable, Generic, TypeVar, cast, overload
from xmlrpc.client import ProtocolError

import requests
Expand Down
4 changes: 2 additions & 2 deletions subliminal/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import logging
import os
import warnings
from typing import TYPE_CHECKING, Any, Sequence
from typing import TYPE_CHECKING, Any

from guessit import guessit # type: ignore[import-untyped]

from subliminal.utils import ensure_list, get_age, matches_extended_title

if TYPE_CHECKING:
from collections.abc import Mapping, Set
from collections.abc import Mapping, Sequence, Set
from datetime import timedelta

from babelfish import Country, Language # type: ignore[import-untyped]
Expand Down

0 comments on commit 24e0d28

Please sign in to comment.