File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 2525SOURCE_URI = 'https://github.com/python/cpython/tree/main/%s'
2626
2727# monkey-patch reST parser to disable alphabetic and roman enumerated lists
28+ def _disable_alphabetic_and_roman (text ):
29+ try :
30+ # docutils >= 0.22
31+ from docutils .parsers .rst .states import InvalidRomanNumeralError
32+ raise InvalidRomanNumeralError (text )
33+ except ImportError :
34+ # docutils < 0.22
35+ return None
36+
37+
2838from docutils .parsers .rst .states import Body
2939Body .enum .converters ['loweralpha' ] = \
3040 Body .enum .converters ['upperalpha' ] = \
3141 Body .enum .converters ['lowerroman' ] = \
32- Body .enum .converters ['upperroman' ] = lambda x : None
42+ Body .enum .converters ['upperroman' ] = _disable_alphabetic_and_roman
3343
3444
3545class PyAwaitableMixin (object ):
You can’t perform that action at this time.
0 commit comments