Commits

Georg Brandl committed 77b4a7c

Closes #905: work around Pygments bug returning str instead of Unicode from Latex formatter for empty input.

Comments (0)

Files changed (1)

sphinx/highlighting.py

             if self.dest == 'html':
                 return hlsource
             else:
+                if not isinstance(hlsource, unicode):  # Py2 / Pygments < 1.6
+                    hlsource = hlsource.decode()
                 return hlsource.translate(tex_hl_escape_map_new)
         except ErrorToken:
             # this is most probably not the selected language,