
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>

[/F]
just for the record, one of those "let's change a lot of code that we don't understand, just because we can"
In the case of try + bare-except, it was more a case of "let's change code we don't understand because it's impossible to guess its intent and that's bad for future maintenance".
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...
Like I said <wink>. The except clause should list the exceptions it specifically intends to silence, and something as obscure as this case deserves a comment to boot.
I also note that if this passed the tests, then the test suite wasn't even trying "the most common use case".
there's-more-than-one-kind-of-breakage-illustrated-here-ly y'rs - tim

[/F]
sure. but who should make sure that the regression test suite covers the code being changed: the person changing it, or the end user?
We could ask a lot of "who should have?" questions here. As it turns out, an end user finished everyone's job here.
learn-&-move-on-ly y'rs - tim
participants (2)
-
Fredrik Lundh
-
Tim Peters