diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-12-30 12:18:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-30 12:18:54 (GMT) |
commit | c88a83e7d81fbf394bbdebe0f453bb64bdf33ba6 (patch) | |
tree | 7ddb3ef57359fee7a4e58bd1aa509a815f31ddcc /Lib/doctest.py | |
parent | dd520e7bae18549971b900b6dadc69bfc35d4b3f (diff) | |
download | cpython-c88a83e7d81fbf394bbdebe0f453bb64bdf33ba6.zip cpython-c88a83e7d81fbf394bbdebe0f453bb64bdf33ba6.tar.gz cpython-c88a83e7d81fbf394bbdebe0f453bb64bdf33ba6.tar.bz2 |
gh-99433: Fix `doctest` failure on `types.MethodWrapperType` (GH-99434)
(cherry picked from commit 79c10b7da84f52999dc483fc62c8e758ad3eff23)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r-- | Lib/doctest.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index b2ef2ce..dafad50 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -956,7 +956,8 @@ class DocTestFinder: return module is inspect.getmodule(object) elif inspect.isfunction(object): return module.__dict__ is object.__globals__ - elif inspect.ismethoddescriptor(object): + elif (inspect.ismethoddescriptor(object) or + inspect.ismethodwrapper(object)): if hasattr(object, '__objclass__'): obj_mod = object.__objclass__.__module__ elif hasattr(object, '__module__'): |