]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-115249: Fix `test_descr` with `-OO` mode (#115250)
authorNikita Sobolev <mail@sobolevn.me>
Sun, 11 Feb 2024 08:00:44 +0000 (11:00 +0300)
committerGitHub <noreply@github.com>
Sun, 11 Feb 2024 08:00:44 +0000 (11:00 +0300)
Lib/test/test_descr.py

index beeab6cb7f254c1e7d034684b7122cbbd8a294de..5404d8d3b99d5d41c4e716aeb541de805ef590da 100644 (file)
@@ -1594,7 +1594,11 @@ class ClassPropertiesAndMethods(unittest.TestCase):
 
         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__}