Skip to content

Commit 2173665

Browse files
committed
Fix fnmatch support in Python >= 3.14
1 parent 33058bf commit 2173665

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/python.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def __init__(self, *args, **kwargs):
111111

112112
def glob2re(g):
113113
pattern = fnmatch.translate(g)
114-
if pattern.startswith('(?s:') and pattern.endswith(')\\Z'):
115-
# Python >= 3.6
114+
if pattern.startswith('(?s:') and pattern.endswith((')\\Z', ')\\z')):
115+
# \Z from Python 3.6 to 3.13, \z for Python >= 3.14
116116
return pattern[4:-3] + '\\Z'
117117
elif pattern.endswith('\\Z(?ms)'):
118118
# Python >= 2.6 and < 3.6

0 commit comments

Comments
 (0)