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 15
15
# This file has been altered from its original form.
16
16
17
17
import re
18
+ from typing import List
18
19
19
20
_double_star_after_invalid_regex = re .compile (r'[^/\\]\*\*' )
20
21
_double_star_first_before_invalid_regex = re .compile ('^\\ *\\ *[^/]' )
@@ -42,7 +43,7 @@ def _match_component(pattern_component: str, file_name_component: str) -> bool:
42
43
return _match_component (pattern_component [1 :], file_name_component [1 :])
43
44
44
45
45
- def _match_components (pattern_components : list [str ], file_name_components : list [str ]) -> bool :
46
+ def _match_components (pattern_components : List [str ], file_name_components : List [str ]) -> bool :
46
47
if len (pattern_components ) == 0 and len (file_name_components ) == 0 :
47
48
return True
48
49
if len (pattern_components ) == 0 :
@@ -83,5 +84,5 @@ def match(pattern: str, file_name: str) -> bool:
83
84
pattern = pattern .replace ('**/**' , '**' )
84
85
pattern_components = pattern .split ('/' )
85
86
# We split on '\' as well as '/' to support unix and windows-style paths
86
- file_name_components : list [str ] = re .split (r'[\\/]' , file_name )
87
+ file_name_components : List [str ] = re .split (r'[\\/]' , file_name )
87
88
return _match_components (pattern_components , file_name_components )
You can’t perform that action at this time.
0 commit comments