Skip to content

Commit 956419b

Browse files
committed
#23 Fix Python 3.9 compatibility
1 parent ac75467 commit 956419b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sanpo/sanitize.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
from collections.abc import Iterable
66
from pathlib import Path
7+
from typing import Union
78

89
_LINE_PATTERNS_TO_REMOVE = [
910
re.compile(line)
@@ -22,7 +23,7 @@
2223
_log = logging.getLogger("sanpo")
2324

2425

25-
def sanitize_file(po_path: Path | str):
26+
def sanitize_file(po_path: Union[Path, str]):
2627
actual_po_path = path_from(po_path)
2728
_log.info("sanitizing %s", actual_po_path)
2829
with actual_po_path.open(encoding="utf-8") as po_file:
@@ -32,7 +33,7 @@ def sanitize_file(po_path: Path | str):
3233
po_file.write(line_to_write)
3334

3435

35-
def path_from(po_path: Path | str) -> Path:
36+
def path_from(po_path: Union[Path, str]) -> Path:
3637
if isinstance(po_path, Path):
3738
return po_path
3839
if isinstance(po_path, str):

0 commit comments

Comments
 (0)