SIGN IN SIGN UP

gh-107715: Escape class name in regular expression (GH-107716)

This patch escapes the class name before embedding it in the regular expression
for `pat` in `doctest.DocTestFinder._find_lineno`. While class names do not
ordinarily contain special characters, it is possible to encounter these when a
class is created dynamically. Escaping the name will correctly return `None` in
this scenario, rather than potentially matching a different class or raising
`re.error` depending on the symbols used.
G
Gertjan van Zwieten committed
85793278793708ad6b7132a54ac9fb4b2c5bcac1
Parent: ed64204
Committed by GitHub <noreply@github.com> on 8/7/2023, 3:24:02 PM