Closes #1748: SyntaxError in sphinx/ext/ifconfig.py with Python 2.6.

This commit is contained in:
shimizukawa
2015-03-02 22:43:14 +09:00
parent 03a60a39fb
commit d23f3e75dd
5 changed files with 42 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ Bugs fixed
msgid such as "foo bar" and "version changes in 1.3: foo bar".
* #1745: latex builder cause maximum recursion depth exceeded when a
footnote has a footnote mark itself.
* #1748: SyntaxError in sphinx/ext/ifconfig.py with Python 2.6.
Release 1.3b3 (released Feb 24, 2015)

View File

@@ -49,7 +49,7 @@ class IfConfig(Directive):
def process_ifconfig_nodes(app, doctree, docname):
ns = {k: app.config[k] for k in app.config.values}
ns = dict((k, app.config[k]) for k in app.config.values)
ns.update(app.config.__dict__.copy())
ns['builder'] = app.builder.name
for node in doctree.traverse(ifconfig):

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
extensions = ['sphinx.ext.ifconfig']
master_doc = 'index'
confval1 = True
def setup(app):
app.add_config_value('confval1', False, None)
app.add_config_value('confval2', False, None)

View File

@@ -0,0 +1,11 @@
ifconfig
========
.. ifconfig:: confval1
spam
.. ifconfig:: confval2
egg

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
"""
test_ext_ifconfig
~~~~~~~~~~~~~~~~~
Test sphinx.ext.ifconfig extension.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from util import with_app
@with_app(testroot='ext-ifconfig')
def test_ifconfig(app, status, warning):
app.builder.build_all()