[Python-Dev] pre.sub's broken under 2.2

Fredrik Lundh fredrik@pythonware.com
Thu, 27 Jun 2002 21:12:41 +0200


just for the record, one of those "let's change a lot of
code that we don't understand, just because we can"
things broke the "pre" module in 2.2.

someone changed:

            try:
                repl = pcre_expand(_Dummy, repl)
            except:
                m = MatchObject(self, source, 0, end, [])

to

            try:
                repl = pcre_expand(_Dummy, repl)
            except error:
                m = MatchObject(self, source, 0, end, [])

but in the most common use case (replacement strings
containing group references), the pcre_expand function
raises a TypeError exception...

</F>