Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-107715: Escape class name in regular expression (pythonGH-10…
…7716) 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. (cherry picked from commit 8579327) Co-authored-by: Gertjan van Zwieten <git@gjvz.nl>
- Loading branch information