Skip to content

Commit 9a8e7fd

Browse files
committed
utils.str.perlReToReplacer: Return picklable function to String supports py3.14
1 parent bb01d53 commit 9a8e7fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/str.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ def perlReToReplacer(s):
307307
flags = ''.join(flags)
308308
r = perlReToPythonRe(sep.join(('', regexp, flags)))
309309
if g:
310-
return lambda s: r.sub(replace, s)
310+
return functools.partial(r.sub, replace)
311311
else:
312-
return lambda s: r.sub(replace, s, 1)
312+
return functools.partial(r.sub, replace, count=1)
313313

314314
_perlVarSubstituteRe = re.compile(r'\$\{([^}]+)\}|\$([a-zA-Z][a-zA-Z0-9]*)')
315315
def perlVariableSubstitute(vars, text):

0 commit comments

Comments
 (0)