Skip to content

Commit 2839ad0

Browse files
committed
fix compat w/older python
1 parent 7e069e7 commit 2839ad0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

util/vfs.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
from pathlib import Path
3+
from typing import Union
34

45

56
class Vfs:
@@ -13,7 +14,7 @@ def __init__(self):
1314
self.files: dict[str, VirtualFile] = dict()
1415
self.files_to_delete: set[Path] = set()
1516

16-
def delete_glob(self, directory: str | Path, glob: str):
17+
def delete_glob(self, directory: Union[str, Path], glob: str):
1718
"""
1819
Glob for all files on disk that were created by the previous build.
1920
These files should be deleted if this build does not emit them.
@@ -39,7 +40,7 @@ def write(self):
3940
print(f"Deleting {path}")
4041
os.remove(path)
4142

42-
def exists(self, path: str | Path):
43+
def exists(self, path: Union[str, Path]):
4344
return str(path) in self.files
4445

4546
def open(self, path: str | Path, mode: str):

0 commit comments

Comments
 (0)