Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport to Python 3.8.10 #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion a2lparser/a2lparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import glob
from pathlib import Path
from loguru import logger
from typing import Union
from a2lparser.a2l.a2l_yacc import A2LYacc
from a2lparser.a2l.a2l_validator import A2LValidator
from a2lparser.a2lparser_exception import A2LParserException
Expand Down Expand Up @@ -203,7 +204,7 @@ def _load_file(self, filename: str, current_dir: str = None) -> str:
content = self._include_pattern.sub(included_content, content)
return content

def _find_includes(self, content: str) -> str | list | None:
def _find_includes(self, content: str) -> Union[str, list, None]:
"""
Looks for /include {file.a2l} tags inside given content and returns the full filename.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]

[project]
name = "a2lparser"
requires-python = ">=3.11"
requires-python = ">=3.8"
authors = [
{ name = "mrom1", email = "[email protected]" }
]
Expand Down