Use b() so that the regex is a bytestring

This commit is contained in:
Daniel Neuhäuser 2010-08-23 18:16:19 +02:00
parent 630791c42c
commit c0d493cec9

View File

@ -26,6 +26,7 @@ from docutils import nodes
from sphinx.errors import SphinxError
from sphinx.util.png import read_png_depth, write_png_depth
from sphinx.util.osutil import ensuredir, ENOENT
from sphinx.util.pycompat import b
from sphinx.ext.mathbase import setup_math as mathbase_setup, wrap_displaymath
class MathExtError(SphinxError):
@ -58,7 +59,7 @@ DOC_BODY_PREVIEW = r'''
\end{document}
'''
depth_re = re.compile(r'\[\d+ depth=(-?\d+)\]')
depth_re = re.compile(b(r'\[\d+ depth=(-?\d+)\]'))
def render_math(self, math):
"""Render the LaTeX math expression *math* using latex and dvipng.