From 96f9a7248ef41ce8638ffbddc0cf5f8cc3e4c66a Mon Sep 17 00:00:00 2001 From: Piergiorgio Navone Date: Mon, 23 Sep 2024 14:33:46 +0200 Subject: [PATCH] Backport to Python 3.8.10 --- a2lparser/a2lparser.py | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/a2lparser/a2lparser.py b/a2lparser/a2lparser.py index c8e7e42..e7dec25 100644 --- a/a2lparser/a2lparser.py +++ b/a2lparser/a2lparser.py @@ -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 @@ -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. diff --git a/pyproject.toml b/pyproject.toml index 3c6a901..405878e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"] [project] name = "a2lparser" -requires-python = ">=3.11" +requires-python = ">=3.8" authors = [ { name = "mrom1", email = "mrom@linuxmail.org" } ]