mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #5022: latex: crashed with docutils package provided by Debian/Ubuntu
This commit is contained in:
parent
f88767c0ad
commit
49ab23db0b
1
CHANGES
1
CHANGES
@ -20,6 +20,7 @@ Bugs fixed
|
|||||||
* sphinx.testing uses deprecated pytest API; ``Node.get_marker(name)``
|
* sphinx.testing uses deprecated pytest API; ``Node.get_marker(name)``
|
||||||
* #5016: ``character_level_inline_markup`` setting is not initialized for
|
* #5016: ``character_level_inline_markup`` setting is not initialized for
|
||||||
combination of non reST source parsers (ex. recommonmark) and docutils-0.13
|
combination of non reST source parsers (ex. recommonmark) and docutils-0.13
|
||||||
|
* #5022: latex: crashed with docutils package provided by Debian/Ubuntu
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -18,7 +18,6 @@ from collections import defaultdict
|
|||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
from docutils import nodes, writers
|
from docutils import nodes, writers
|
||||||
from docutils.utils.roman import toRoman
|
|
||||||
from docutils.writers.latex2e import Babel
|
from docutils.writers.latex2e import Babel
|
||||||
from six import itervalues, text_type
|
from six import itervalues, text_type
|
||||||
|
|
||||||
@ -32,6 +31,12 @@ from sphinx.util.nodes import clean_astext
|
|||||||
from sphinx.util.template import LaTeXRenderer
|
from sphinx.util.template import LaTeXRenderer
|
||||||
from sphinx.util.texescape import tex_escape_map, tex_replace_map
|
from sphinx.util.texescape import tex_escape_map, tex_replace_map
|
||||||
|
|
||||||
|
try:
|
||||||
|
from docutils.utils.roman import toRoman
|
||||||
|
except ImportError:
|
||||||
|
# In Debain/Ubuntu, roman package is provided as roman, not as docutils.utils.roman
|
||||||
|
from roman import toRoman
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
# For type annotation
|
# For type annotation
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Pattern, Tuple, Set, Union # NOQA
|
from typing import Any, Callable, Dict, Iterator, List, Pattern, Tuple, Set, Union # NOQA
|
||||||
|
Loading…
Reference in New Issue
Block a user