🚑 Clarify patch condition for doctest finder hack (#12471)
There was a regression caused by #12431 that excluded the patch on broken CPython patch version ranges 3.11.0–3.11.8 and 3.12.0–3.12.2. This change fixes that by adjusting the patching conditional clause to include said versions. Closes #12430. Co-authored-by: Florian Bruhin <me@the-compiler.org>
This commit is contained in:
parent
fe4961afae
commit
49374ec7a0
|
@ -505,7 +505,13 @@ class DoctestModule(Module):
|
|||
import doctest
|
||||
|
||||
class MockAwareDocTestFinder(doctest.DocTestFinder):
|
||||
if sys.version_info < (3, 11):
|
||||
py_ver_info_minor = sys.version_info[:2]
|
||||
is_find_lineno_broken = (
|
||||
py_ver_info_minor < (3, 11)
|
||||
or (py_ver_info_minor == (3, 11) and sys.version_info.micro < 9)
|
||||
or (py_ver_info_minor == (3, 12) and sys.version_info.micro < 3)
|
||||
)
|
||||
if is_find_lineno_broken:
|
||||
|
||||
def _find_lineno(self, obj, source_lines):
|
||||
"""On older Pythons, doctest code does not take into account
|
||||
|
|
Loading…
Reference in New Issue