mirror of
https://github.com/python/cpython.git
synced 2025-09-16 05:36:29 +00:00
gh-133306: Use \z instead of \Z in fnmatch.translate() and glob.translate() (GH-133338)
This commit is contained in:
parent
cb3174113e
commit
add0ca9ea0
7 changed files with 96 additions and 94 deletions
|
@ -185,7 +185,7 @@ def _translate(pat, star, question_mark):
|
|||
|
||||
def _join_translated_parts(parts, star_indices):
|
||||
if not star_indices:
|
||||
return fr'(?s:{"".join(parts)})\Z'
|
||||
return fr'(?s:{"".join(parts)})\z'
|
||||
iter_star_indices = iter(star_indices)
|
||||
j = next(iter_star_indices)
|
||||
buffer = parts[:j] # fixed pieces at the start
|
||||
|
@ -206,4 +206,4 @@ def _join_translated_parts(parts, star_indices):
|
|||
append('.*')
|
||||
extend(parts[i:])
|
||||
res = ''.join(buffer)
|
||||
return fr'(?s:{res})\Z'
|
||||
return fr'(?s:{res})\z'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue