Commits

Anonymous committed 09a8baa

Use b() so that the regex is a bytestring

  • Participants
  • Parent commits d3456c0

Comments (0)

Files changed (1)

sphinx/ext/pngmath.py

 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):
 \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.