From 89d41cba392b759732ba9f1db4ff29ed47da6a56 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Mon, 25 Nov 2019 10:33:34 +0100 Subject: [PATCH] Fixed #31025 -- Fixed highlightlinenothreshold deprecation warning on Sphinx 1.8+. --- docs/_ext/djangodocs.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py index d33d48a1eb..95ae530680 100644 --- a/docs/_ext/djangodocs.py +++ b/docs/_ext/djangodocs.py @@ -254,10 +254,7 @@ def visit_console_html(self, node): self.body.append('
\n' % {'id': uid}) win_text = node['win_console_text'] highlight_args = {'force': True} - if 'linenos' in node: - linenos = node['linenos'] - else: - linenos = win_text.count('\n') >= self.highlightlinenothreshold - 1 + linenos = node.get('linenos', False) def warner(msg): self.builder.warn(msg, (self.builder.current_docname, node.line))