diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index c5ac536ff84..76b657acee6 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -34,7 +34,7 @@ if tuple(map(int, pygments.__version__.split('.')))[:2] < (2, 18): from pygments.formatter import Formatter - Formatter.__class_getitem__ = lambda cls, name: cls + Formatter.__class_getitem__ = lambda cls, name: cls # type: ignore[attr-defined] logger = logging.getLogger(__name__) diff --git a/tests/test_highlighting.py b/tests/test_highlighting.py index 7149cf13c7e..1b8c2fbff73 100644 --- a/tests/test_highlighting.py +++ b/tests/test_highlighting.py @@ -11,7 +11,7 @@ if tuple(map(int, pygments.__version__.split('.')))[:2] < (2, 18): from pygments.formatter import Formatter - Formatter.__class_getitem__ = lambda cls, name: cls + Formatter.__class_getitem__ = lambda cls, name: cls # type: ignore[attr-defined] class MyLexer(RegexLexer):