diff options
| author | Dmitry Shachnev <mitya57@debian.org> | 2016-12-18 05:11:46 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-09 02:32:18 -0500 |
| commit | 5bd6ccd9c95fdf068e125e08992c7424eb2ceabb (patch) | |
| tree | 0a03c8aa21ad3e497b07c6e3872119a9a8f68279 /Documentation | |
| parent | fab303ba78ee2bae3da057f750139fc6222c66d5 (diff) | |
docs: sphinx-extensions: make rstFlatTable work with docutils 0.13
commit 217e2bfab22e740227df09f22165e834cddd8a3b upstream.
In docutils 0.13, the return type of get_column_widths method of the
Table directive has changed [1], which breaks our flat-table directive
and leads to a TypeError when trying to build the docs [2].
This patch adds support for the new return type, while keeping support
for older docutils versions too.
[1] https://sourceforge.net/p/docutils/patches/120/
[2] https://sourceforge.net/p/docutils/bugs/303/
Signed-off-by: Dmitry Shachnev <mitya57@debian.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation')
| -rwxr-xr-x | Documentation/sphinx/rstFlatTable.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/sphinx/rstFlatTable.py b/Documentation/sphinx/rstFlatTable.py index 55f275793028..25feb0d35e7a 100755 --- a/Documentation/sphinx/rstFlatTable.py +++ b/Documentation/sphinx/rstFlatTable.py | |||
| @@ -157,6 +157,11 @@ class ListTableBuilder(object): | |||
| 157 | def buildTableNode(self): | 157 | def buildTableNode(self): |
| 158 | 158 | ||
| 159 | colwidths = self.directive.get_column_widths(self.max_cols) | 159 | colwidths = self.directive.get_column_widths(self.max_cols) |
| 160 | if isinstance(colwidths, tuple): | ||
| 161 | # Since docutils 0.13, get_column_widths returns a (widths, | ||
| 162 | # colwidths) tuple, where widths is a string (i.e. 'auto'). | ||
| 163 | # See https://sourceforge.net/p/docutils/patches/120/. | ||
| 164 | colwidths = colwidths[1] | ||
| 160 | stub_columns = self.directive.options.get('stub-columns', 0) | 165 | stub_columns = self.directive.options.get('stub-columns', 0) |
| 161 | header_rows = self.directive.options.get('header-rows', 0) | 166 | header_rows = self.directive.options.get('header-rows', 0) |
| 162 | 167 | ||
