Skip to content

Commit 31ef622

Browse files
authored
Merge pull request #7509 from tacaswell/fix_lpy_encoding
FIX: workaround py2 unicode issues
2 parents 08eccfb + b467001 commit 31ef622

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/sphinxext/gen_gallery.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: UTF-8 -*-
1+
# -*- coding: utf-8 -*-
22
import codecs
33
import os
44
import re
@@ -14,7 +14,7 @@
1414
multiimage = re.compile('(.*?)(_\d\d){1,2}')
1515

1616
# generate a thumbnail gallery of examples
17-
gallery_template = """\
17+
gallery_template = u"""\
1818
{{% extends "layout.html" %}}
1919
{{% set title = "Thumbnail gallery" %}}
2020
@@ -35,7 +35,7 @@
3535
{{% endblock %}}
3636
"""
3737

38-
header_template = """\
38+
header_template = u"""\
3939
<div class="section" id="{section}">
4040
<h4>
4141
{title}<a class="headerlink" href="#{section}" title="Permalink to this headline">¶</a>
@@ -48,7 +48,7 @@
4848
</figure>
4949
"""
5050

51-
toc_template = """\
51+
toc_template = u"""\
5252
<li><a class="reference internal" href="#{section}">{title}</a></li>"""
5353

5454

@@ -133,10 +133,10 @@ def gen_gallery(app, doctree):
133133
warnings.warn("No thumbnails were found in %s" % subdir)
134134

135135
# Close out the <div> opened up at the top of this loop
136-
rows.append("</div>")
136+
rows.append(u"</div>")
137137

138-
content = gallery_template.format(toc='\n'.join(toc_rows),
139-
gallery='\n'.join(rows))
138+
content = gallery_template.format(toc=u'\n'.join(toc_rows),
139+
gallery=u'\n'.join(rows))
140140

141141
# Only write out the file if the contents have actually changed.
142142
# Otherwise, this triggers a full rebuild of the docs

0 commit comments

Comments
 (0)