File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
from pathlib import Path
3
+ from typing import Union
3
4
4
5
5
6
class Vfs :
@@ -13,7 +14,7 @@ def __init__(self):
13
14
self .files : dict [str , VirtualFile ] = dict ()
14
15
self .files_to_delete : set [Path ] = set ()
15
16
16
- def delete_glob (self , directory : str | Path , glob : str ):
17
+ def delete_glob (self , directory : Union [ str , Path ] , glob : str ):
17
18
"""
18
19
Glob for all files on disk that were created by the previous build.
19
20
These files should be deleted if this build does not emit them.
@@ -39,10 +40,10 @@ def write(self):
39
40
print (f"Deleting { path } " )
40
41
os .remove (path )
41
42
42
- def exists (self , path : str | Path ):
43
+ def exists (self , path : Union [ str , Path ] ):
43
44
return str (path ) in self .files
44
45
45
- def open (self , path : str | Path , mode : str ):
46
+ def open (self , path : Union [ str , Path ] , mode : str ):
46
47
path = str (path )
47
48
modes = set (mode )
48
49
if "b" in modes :
You can’t perform that action at this time.
0 commit comments