File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ Release 8.0.1 (in development)
44Bugs fixed
55----------
66
7+ * Patch ``pygments.Formatter.__class_getitem__ `` in Pygments 2.17.
8+ Patch by Adam Turner.
79
810Release 8.0.0 (released Jul 29, 2024)
911=====================================
Original file line number Diff line number Diff line change 66from importlib import import_module
77from typing import TYPE_CHECKING , Any
88
9+ import pygments
910from pygments import highlight
1011from pygments .filters import ErrorToken
1112from pygments .formatters import HtmlFormatter , LatexFormatter
3031 from pygments .lexer import Lexer
3132 from pygments .style import Style
3233
34+ if tuple (map (int , pygments .__version__ .split ('.' )))[:2 ] < (2 , 18 ):
35+ from pygments .formatter import Formatter
36+
37+ Formatter .__class_getitem__ = lambda cls , name : cls
38+
3339logger = logging .getLogger (__name__ )
3440
3541lexers : dict [str , Lexer ] = {}
Original file line number Diff line number Diff line change 22
33from unittest import mock
44
5+ import pygments
56from pygments .formatters .html import HtmlFormatter
67from pygments .lexer import RegexLexer
78from pygments .token import Name , Text
89
910from sphinx .highlighting import PygmentsBridge
1011
12+ if tuple (map (int , pygments .__version__ .split ('.' )))[:2 ] < (2 , 18 ):
13+ from pygments .formatter import Formatter
14+ Formatter .__class_getitem__ = lambda cls , name : cls
15+
1116
1217class MyLexer (RegexLexer ):
1318 name = 'testlexer'
You can’t perform that action at this time.
0 commit comments