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 25
25
SOURCE_URI = 'https://github.com/python/cpython/tree/main/%s'
26
26
27
27
# 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
+
28
38
from docutils .parsers .rst .states import Body
29
39
Body .enum .converters ['loweralpha' ] = \
30
40
Body .enum .converters ['upperalpha' ] = \
31
41
Body .enum .converters ['lowerroman' ] = \
32
- Body .enum .converters ['upperroman' ] = lambda x : None
42
+ Body .enum .converters ['upperroman' ] = _disable_alphabetic_and_roman
33
43
34
44
35
45
class PyAwaitableMixin (object ):
You can’t perform that action at this time.
0 commit comments