docs: Fix conf.py for Sphinx 2.0 [Linux 5.2]

docs: Fix conf.py for Sphinx 2.0 [Linux 5.2]

This Linux kernel change "docs: Fix conf.py for Sphinx 2.0" is included in the Linux 5.2 release. This change is authored by Jonathan Corbet <corbet [at] lwn.net> on Wed May 22 14:30:45 2019 -0600. The commit for this change in Linux stable tree is 3bc8088 (patch).

docs: Fix conf.py for Sphinx 2.0

Our version check in Documentation/conf.py never envisioned a world where
Sphinx moved beyond 1.x.  Now that the unthinkable has happened, fix our
version check to handle higher version numbers correctly.

Cc: [email protected]
Signed-off-by: Jonathan Corbet <[email protected]>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 Documentation/conf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 72647a3..7ace3f8 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -37,7 +37,7 @@ needs_sphinx = '1.3'
 extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'cdomain', 'kfigure', 'sphinx.ext.ifconfig']

 # The name of the math extension changed on Sphinx 1.4
-if major == 1 and minor > 3:
+if (major == 1 and minor > 3) or (major > 1):
     extensions.append("sphinx.ext.imgmath")
 else:
     extensions.append("sphinx.ext.pngmath")

Leave a Reply

Your email address will not be published. Required fields are marked *