]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-115249: Fix `test_descr` with `-OO` mode (GH-115250) (#115278)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 11 Feb 2024 08:57:58 +0000 (09:57 +0100)
committerGitHub <noreply@github.com>
Sun, 11 Feb 2024 08:57:58 +0000 (11:57 +0300)
gh-115249: Fix `test_descr` with `-OO` mode (GH-115250)
(cherry picked from commit 1f23837277e604f41589273aeb3a10377d416510)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Lib/test/test_descr.py

index e356624af04e7e9f83e27a6110844f75066a3fd0..ee8958f5e3577f105a321f652f916f3b1422a07d 100644 (file)
@@ -1587,7 +1587,11 @@ order (MRO) for bases """
 
         cm = classmethod(f)
         cm_dict = {'__annotations__': {},
-                   '__doc__': "f docstring",
+                   '__doc__': (
+                       "f docstring"
+                       if support.HAVE_DOCSTRINGS
+                       else None
+                    ),
                    '__module__': __name__,
                    '__name__': 'f',
                    '__qualname__': f.__qualname__}