diff options
author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-12-17 12:17:32 +0000 |
---|---|---|
committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-12-17 12:17:32 +0000 |
commit | 9384edebf2178318103f9cb1ce74959aa575bb56 (patch) | |
tree | a79b6432b4c0ce841d1d17233604e6153ce6883a | |
parent | e5205aa6ce6e594544f8e80cf8c3b47803b3b97f (diff) | |
download | docutils-9384edebf2178318103f9cb1ce74959aa575bb56.tar.gz |
Fix [bugs:#463]. Spurious comma in deprecation warning.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9310 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r-- | docutils/HISTORY.txt | 7 | ||||
-rw-r--r-- | docutils/docutils/nodes.py | 2 | ||||
-rwxr-xr-x | docutils/test/test_nodes.py | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt index 5ca3bf227..7a99ae8a4 100644 --- a/docutils/HISTORY.txt +++ b/docutils/HISTORY.txt @@ -34,6 +34,7 @@ Changes Since 0.19 - Fix `previous_sibling()` method that led to invalid HTML in some cases (cf. patch #195). + - Fix bug #463. Spurious comma in deprecation warning. * docutils/parsers/recommonmark_wrapper.py @@ -67,8 +68,8 @@ Changes Since 0.19 Changes to the HTML output (no space character before closing tag of XML declaration, order of metadata elements) don't affect the HTML semantics, styling, and rendering. - - - Wrap definition lists with "details" class argument in a <div> + + - Wrap definition lists with "details" class argument in a <div> with the "id" and "class" values of the list node. - Use dpub-ARIA role "doc-footnote" (instead of ARIA role "note") @@ -4150,7 +4151,7 @@ test/test_rst); and all modifications required to make it all work. .. _view_mode: docs/user/config.html#view-mode - + .. Local Variables: mode: indented-text diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index c1481c16e..ec93609cd 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -1068,7 +1068,7 @@ class Element(Node): def set_class(self, name): """Add a new class to the "classes" attribute.""" warnings.warn('docutils.nodes.Element.set_class() is deprecated; ' - ' and will be removed in Docutils 0.21 or later.', + ' and will be removed in Docutils 0.21 or later.' "Append to Element['classes'] list attribute directly", DeprecationWarning, stacklevel=2) assert ' ' not in name diff --git a/docutils/test/test_nodes.py b/docutils/test/test_nodes.py index a07827094..ab09ca0de 100755 --- a/docutils/test/test_nodes.py +++ b/docutils/test/test_nodes.py @@ -352,6 +352,11 @@ class ElementTests(unittest.TestCase): node = nodes.Element('Möhren', nodes.Text('Möhren')) self.assertEqual(str(node), '<Element>Möhren</Element>') + def test_set_class_deprecation_warning(self): + node = nodes.Element('test node') + with self.assertWarns(DeprecationWarning): + node.set_class('parrot') + class MiscTests(unittest.TestCase): |