Re: [PATCH 1/2] docs: python: abi_regex: catch the right exception for a bad regex

Jonathan Corbet <[email protected]>
Newsgroups dev.linux.lists.sashiko-reviews,org.kernel.vger.linux-cxl,org.kernel.vger.linux-doc
Message-ID <[email protected]>
Alison Schofield <[email protected]> writes:

> On Fri, Aug 07, 2026 at 12:03:44AM +0000, [email protected] wrote:
>> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>> - [Medium] The patch replaces `re.PatternError` with `re.error` rather than catching both, directly contradicting the commit message and exposing a misunderstanding of standard Python.
>
> It does indeed catch both by simply using 're.error'.
>
> re.PatternError is not a separate exception because re.error was
> kept as an alias for backward compatibility.
>
> So yes, a bit of secret sauce not obvious in the commit message.
>
> I'll wait a bit and see if Maintainers want a respin with a commit
> log update for that.

[Almost missed this - said maintainers respond more reliably when copied
on the emails].

Explaining that you're catching the superclass error would have been
better, certainly.  Respin if you like but, in this case, I'm not sure
it's worth the trouble.

Thanks,

jon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.