From acfad857945d0072996df3fd0e3480f666aa2ea2 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sat, 10 Feb 2024 18:59:14 +0300 Subject: [PATCH] gh-115249: Fix `test_descr` with `-OO` mode --- Lib/test/test_descr.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index beeab6cb7f254c..5404d8d3b99d5d 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1594,7 +1594,11 @@ def f(cls, arg): 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__}