]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-35753: Fix crash in doctest with unwrap-able functions (#22981)
authorAlfred Perlstein <alfred@fb.com>
Wed, 5 May 2021 17:33:17 +0000 (10:33 -0700)
committerGitHub <noreply@github.com>
Wed, 5 May 2021 17:33:17 +0000 (19:33 +0200)
commit565a31804c1139fe7886f38af3b3923653b0c1b3
tree51668e21735777de13b878981d6d941017038316
parentcf86996a8e5965ff587040d0c2831c3132081a21
bpo-35753: Fix crash in doctest with unwrap-able functions (#22981)

Ignore objects that inspect.unwrap throws due to
too many wrappers.  This is a very rare case, however
it can easily be surfaced when a module under doctest
imports unitest.mock.call into its namespace.

We simply skip any object that throws this exception.
This should handle the majority of cases.
Lib/doctest.py
Lib/test/test_doctest.py
Misc/NEWS.d/next/Tests/2020-10-25-19-20-26.bpo-35753.2LT-hO.rst [new file with mode: 0644]