[Python-checkins] python/dist/src/Lib pre.py,1.10,1.10.18.1
mwh@users.sourceforge.net
mwh@users.sourceforge.net
Fri, 23 Aug 2002 09:34:11 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv20709
Modified Files:
Tag: release22-maint
pre.py
Log Message:
backport effbot's checkin of
revision 1.13 of pre.py
Fix bug #570057: Broken pre.subn() (and pre.sub())
This should be backported to the 2.2.X series (how
do I do that?)
Index: pre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pre.py,v
retrieving revision 1.10
retrieving revision 1.10.18.1
diff -C2 -d -r1.10 -r1.10.18.1
*** pre.py 11 May 2001 19:20:17 -0000 1.10
--- pre.py 23 Aug 2002 16:34:08 -0000 1.10.18.1
***************
*** 362,369 ****
if type(repl) is type(''):
! # See if repl contains group references
try:
repl = pcre_expand(_Dummy, repl)
! except error:
m = MatchObject(self, source, 0, end, [])
repl = lambda m, repl=repl, expand=pcre_expand: expand(m, repl)
--- 362,371 ----
if type(repl) is type(''):
! # See if repl contains group references (if it does,
! # pcre_expand will attempt to call _Dummy.group, which
! # results in a TypeError)
try:
repl = pcre_expand(_Dummy, repl)
! except (error, TypeError):
m = MatchObject(self, source, 0, end, [])
repl = lambda m, repl=repl, expand=pcre_expand: expand(m, repl)