mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1748: SyntaxError in sphinx/ext/ifconfig.py with Python 2.6.
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -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)
|
||||
|
@@ -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):
|
||||
|
10
tests/roots/test-ext-ifconfig/conf.py
Normal file
10
tests/roots/test-ext-ifconfig/conf.py
Normal 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)
|
11
tests/roots/test-ext-ifconfig/index.rst
Normal file
11
tests/roots/test-ext-ifconfig/index.rst
Normal file
@@ -0,0 +1,11 @@
|
||||
ifconfig
|
||||
========
|
||||
|
||||
.. ifconfig:: confval1
|
||||
|
||||
spam
|
||||
|
||||
.. ifconfig:: confval2
|
||||
|
||||
egg
|
||||
|
19
tests/test_ext_ifconfig.py
Normal file
19
tests/test_ext_ifconfig.py
Normal 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()
|
Reference in New Issue
Block a user