Skip to content

Commit dd0b3c2

Browse files
authored
Fix extmatch negation case (#219)
Fixes #218
1 parent df834c7 commit dd0b3c2

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

docs/src/markdown/about/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 8.5.2
4+
5+
- **FIX**: Fix `pathlib` issue with inheritance on Python versions greater than 3.12.
6+
- **FIX**: Fix `EXTMATCH` case with `!(...)` patterns.
7+
38
## 8.5.1
49

510
- **FIX**: Fix issue with type check failure in `wcmatch.glob`.

tests/test_fnmatch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ class TestFnMatch:
148148
['!(test)', 'abc', True, fnmatch.D | fnmatch.E],
149149
['!(test)', '..', False, fnmatch.D | fnmatch.E],
150150

151+
# Negation list followed by extended list
152+
['!(2)_@(foo|bar)', '1_foo', True, fnmatch.E],
153+
['!(!(2|3))_@(foo|bar)', '2_foo', True, fnmatch.E],
154+
151155
# POSIX style character classes
152156
['[[:alnum:]]bc', 'zbc', True, 0],
153157
['[[:alnum:]]bc', '1bc', True, 0],

wcmatch/__meta__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,5 @@ def parse_version(ver: str) -> Version:
194194
return Version(major, minor, micro, release, pre, post, dev)
195195

196196

197-
__version_info__ = Version(8, 5, 1, "final")
197+
__version_info__ = Version(8, 5, 2, "final")
198198
__version__ = __version_info__._get_canonical()

wcmatch/_wcparse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,8 @@ def parse_extend(self, c: str, i: util.StringIter, current: list[str], reset_dot
14351435
extended.append(self._restrict_extended_slash())
14361436
extended.append(self.sep)
14371437
elif c == "|":
1438-
self.clean_up_inverse(extended, temp_inv_nest and self.inv_nest)
1438+
if self.inv_nest:
1439+
self.clean_up_inverse(extended, temp_inv_nest)
14391440
extended.append(c)
14401441
if temp_after_start:
14411442
self.set_start_dir()

0 commit comments

Comments
 (0)