8000 Fix type annotation to use typing module for compatibility · advanced-security/filter-sarif@da42f62 · GitHub
[go: up one dir, main page]

Skip to content

Commit da42f62

Browse files
committed
Fix type annotation to use typing module for compatibility
1 parent eac3ea6 commit da42f62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

globber.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# This file has been altered from its original form.
1616

1717
import re
18+
from typing import List
1819

1920
_double_star_after_invalid_regex = re.compile(r'[^/\\]\*\*')
2021
_double_star_first_before_invalid_regex = re.compile('^\\*\\*[^/]')
@@ -42,7 +43,7 @@ def _match_component(pattern_component: str, file_name_component: str) -> bool:
4243
return _match_component(pattern_component[1:], file_name_component[1:])
4344

4445

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:
4647
if len(pattern_components) == 0 and len(file_name_components) == 0:
4748
return True
4849
if len(pattern_components) == 0:
@@ -83,5 +84,5 @@ def match(pattern: str, file_name: str) -> bool:
8384
pattern = pattern.replace('**/**', '**')
8485
pattern_components = pattern.split('/')
8586
# 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)
8788
return _match_components(pattern_components, file_name_components)

0 commit comments

Comments
 (0)
0