From b0809b89ecdf430c9f6e0272fb4cf0dc01a4989d Mon Sep 17 00:00:00 2001 From: Andrew Donnellan Date: Wed, 7 Jun 2017 18:12:21 +1000 Subject: doc: Fix output of version string when using Sphinx with Python 3 Our Sphinx configuration gets the current skiboot version by using the subprocess module to run make_version.sh. In Python 2, this returns a value of type str, but in Python 3, this returns bytes instead. Decode those bytes into a string so we see "skiboot 5.6.blah" rather than "skiboot b'5.6.blah\n'" in the documentation output. Tested using Sphinx with both Python 2 and 3. Signed-off-by: Andrew Donnellan Signed-off-by: Stewart Smith --- doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/conf.py b/doc/conf.py index fe37fbf..edd7f27 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -58,9 +58,9 @@ copyright = u'2016, Stewart Smith, IBM, others' # # The short X.Y version. import subprocess -version = subprocess.check_output("../make_version.sh | sed -e 's/skiboot-//'", shell=True) +version = subprocess.check_output("../make_version.sh | sed -e 's/skiboot-//'", shell=True).decode() # The full version, including alpha/beta/rc tags. -release = subprocess.check_output("../make_version.sh | sed -e 's/skiboot-//'", shell=True) +release = subprocess.check_output("../make_version.sh | sed -e 's/skiboot-//'", shell=True).decode() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -- cgit v1.1