Skip to content

Commit

Permalink
add back compat with python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Jan 2, 2025
1 parent e10bf9c commit 98549ce
Show file tree
Hide file tree
Showing 13 changed files with 571 additions and 808 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Test"

on:
push:
branches: ["master", "dev", "github-action"]
branches: ["master", "dev", "github-action", "python3.9"]
pull_request:
schedule:
- cron: "33 1 * * 3"
Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion pyglossary/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def __init__(
"x": xdxf.
"""
# memory optimization:
if isinstance(word, list | tuple):
if isinstance(word, (list, tuple)):
if len(word) == 1:
word = word[0]
elif not isinstance(word, str):
Expand Down
2 changes: 1 addition & 1 deletion pyglossary/glossary_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
# ]


@dataclass(slots=True, frozen=True)
@dataclass(frozen=True)
class ConvertArgs:
inputFilename: str
inputFormat: str = ""
Expand Down
5 changes: 3 additions & 2 deletions pyglossary/json_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
if TYPE_CHECKING:
from typing import AnyStr, TypeAlias

__all__ = ["dataToPrettyJson", "jsonToData"]
JsonEncodable: TypeAlias = dict | list


JsonEncodable: TypeAlias = dict | list
__all__ = ["dataToPrettyJson", "jsonToData"]


def dataToPrettyJson(
Expand Down
2 changes: 1 addition & 1 deletion pyglossary/plugins/appledict_bin/appledict_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
__all__ = ["AppleDictProperties", "from_metadata"]


@dataclass(slots=True, frozen=True)
@dataclass(frozen=True)
class AppleDictProperties:
# in plist file: IDXDictionaryVersion
# values := (1 | 2 | 3)
Expand Down
2 changes: 1 addition & 1 deletion pyglossary/plugins/babylon_bgl/bgl_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
__all__ = ["BabylonLanguage", "languageByCode"]


@dataclass(slots=True, frozen=True)
@dataclass(frozen=True)
class BabylonLanguage:

"""
Expand Down
2 changes: 1 addition & 1 deletion pyglossary/plugins/freedict/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
NAMESPACE = {None: "http://www.tei-c.org/ns/1.0"}


@dataclass(slots=True)
@dataclass
class ParsedSense:
transCits: list[Element]
defs: list[Element]
Expand Down
Loading

0 comments on commit 98549ce

Please sign in to comment.