File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 44import re
55from collections .abc import Iterable
66from pathlib import Path
7+ from typing import Union
78
89_LINE_PATTERNS_TO_REMOVE = [
910 re .compile (line )
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 ):
You can’t perform that action at this time.
0 commit comments