Skip to content

Commit e856b05

Browse files
authored
Merge pull request sherlock-project#2636 from simplyNour/Bug/fix-gradle-false-pos-test-failure
Bug: Fix local variable scoping issue affecting false-pos test output
2 parents 842ae1f + 45494fc commit e856b05

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tests/test_validate_targets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def set_pattern_upper_bound(pattern: str, upper_bound: int = FALSE_POSITIVE_QUAN
1616
"""Set upper bound for regex patterns that use quantifiers such as `+` `*` or `{n,}`."""
1717
def replace_upper_bound(match: re.Match) -> str: # type: ignore
1818
lower_bound: int = int(match.group(1)) if match.group(1) else 0 # type: ignore
19+
nonlocal upper_bound
1920
upper_bound = upper_bound if lower_bound < upper_bound else lower_bound # type: ignore # noqa: F823
2021
return f'{{{lower_bound},{upper_bound}}}'
2122

0 commit comments

Comments
 (0)