[/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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4