diff --git a/config_converter/converters/yaml_converter.py b/config_converter/converters/yaml_converter.py index 70f8c18..d1cf0e6 100644 --- a/config_converter/converters/yaml_converter.py +++ b/config_converter/converters/yaml_converter.py @@ -1,7 +1,7 @@ """YAML format converter.""" from pathlib import Path -from typing import Any, Dict +from typing import Any, Dict, Union import yaml @@ -14,7 +14,7 @@ class YamlConverter(BaseConverter): FORMAT_NAME = "yaml" FILE_EXTENSIONS = ["yaml", "yml"] - def read(self, source: str | Path) -> Dict[str, Any]: + def read(self, source: Union[str, Path]) -> Dict[str, Any]: """Read and parse a YAML configuration file.""" try: with open(source, "r", encoding="utf-8") as f: @@ -26,7 +26,7 @@ class YamlConverter(BaseConverter): except PermissionError as e: raise ConversionError(f"Permission denied: {source}") from e - def write(self, data: Dict[str, Any], target: str | Path) -> None: + def write(self, data: Dict[str, Any], target: Union[str, Path]) -> None: """Write configuration data to a YAML file.""" try: with open(target, "w", encoding="utf-8") as f: