Skip to content

Commit

Permalink
fix: Fix Python 3.8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
tkarabela committed May 5, 2024
1 parent cf2fd14 commit 472664a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pysubs2/microdvd.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from functools import partial
import re
from typing import Optional, TextIO, Any, TYPE_CHECKING
from typing import Optional, TextIO, Any, Match, TYPE_CHECKING

from .exceptions import UnknownFPSError
from .ssaevent import SSAEvent
Expand Down Expand Up @@ -71,7 +71,7 @@ def from_file(cls, subs: "SSAFile", fp: TextIO, format_: str, fps: Optional[floa
def prepare_text(text: str) -> str:
text = text.replace("|", r"\N")

def style_replacer(match: re.Match[str]) -> str:
def style_replacer(match: Match[str]) -> str:
tags = [c for c in "biu" if c in match.group(0)]
return "{%s}" % "".join(f"\\{c}1" for c in tags)

Expand Down
3 changes: 1 addition & 2 deletions pysubs2/ssafile.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from collections.abc import MutableSequence
import io
from io import open
from itertools import chain
import os.path
import logging
from typing import Optional, List, Dict, Iterable, Any, overload, Iterator, TextIO, Tuple
from typing import Optional, List, Dict, Iterable, Any, overload, Iterator, TextIO, Tuple, MutableSequence

from .common import IntOrFloat
from .formats import autodetect_format, get_format_class, get_format_identifier
Expand Down

0 comments on commit 472664a

Please sign in to comment.